diff --git a/doc/design/cpp_data_feeding.md b/doc/design/cpp_data_feeding.md index a122af8cb9002cbf126c3b2a22ebdfc9a78f9e93..22c2a925eb8c5e1dd8451e1d3cba261ce471ec51 100644 --- a/doc/design/cpp_data_feeding.md +++ b/doc/design/cpp_data_feeding.md @@ -20,7 +20,7 @@ class ReaderBase { PADDLE_ENFORCE(!shapes_.empty()); } // Read the next batch of data. (A 'batch' can be only one instance) - // If the next batch doesn't exist, the 'out' will be an empty std::vector. + // If the next batch doesn't exist, the '*out' will be an empty std::vector. virtual void ReadNext(std::vector* out) = 0; // Reinitialize the reader and read the file from the begin. diff --git a/paddle/fluid/operators/reader/create_batch_reader_op.cc b/paddle/fluid/operators/reader/create_batch_reader_op.cc index 9559159e8298973d2c24d3ee820a8b2b42d80275..277f2856c07b3fec2113486539aec1d9139fae92 100644 --- a/paddle/fluid/operators/reader/create_batch_reader_op.cc +++ b/paddle/fluid/operators/reader/create_batch_reader_op.cc @@ -70,7 +70,7 @@ void BatchReader::ReadNext(std::vector* out) { for (int i = 0; i < batch_size_; ++i) { buffer_.push_back(std::vector()); reader_->ReadNext(&buffer_.back()); - if (buffer.back().empty()) { + if (buffer_.back().empty()) { buffer_.pop_back(); break; }