diff --git a/paddle/fluid/operators/reader/open_files_op.cc b/paddle/fluid/operators/reader/open_files_op.cc index c0526e45f4d1d7e5ec8ae242202a717a02396671..2cbae8a90a96183cc3fa95e66c48b341086b6b6d 100644 --- a/paddle/fluid/operators/reader/open_files_op.cc +++ b/paddle/fluid/operators/reader/open_files_op.cc @@ -27,7 +27,7 @@ class MultiFileReader : public framework::ReaderBase { const std::vector& dims, size_t thread_num, size_t buffer_size) : buffer_size_(buffer_size) { - readers_.resize(file_names.size()); + readers_.reserve(file_names.size()); for (const std::string& f_name : file_names) { readers_.emplace_back(CreateReaderByFileName(f_name, dims)); }