diff --git a/paddle/fluid/framework/mixed_vector.h b/paddle/fluid/framework/mixed_vector.h index f2039ba7a5da84e9cf836a335d4841a668991157..4a2b378887e64525cafcc9aaacf36e78661dcc92 100644 --- a/paddle/fluid/framework/mixed_vector.h +++ b/paddle/fluid/framework/mixed_vector.h @@ -182,7 +182,7 @@ class Vector { void Extend(It begin, It end) { MutableCPU(); cpu_.reserve((end - begin) + cpu_.size()); - std::copy(begin, end, cpu_.begin()); + std::copy(begin, end, std::back_inserter>(cpu_)); } // resize the vector