From 6e5736e2700decf5b991e0f84216fcea13983834 Mon Sep 17 00:00:00 2001 From: fengjiayi Date: Fri, 9 Mar 2018 15:07:20 +0800 Subject: [PATCH] fix a compile error --- doc/design/cpp_data_feeding.md | 2 +- paddle/fluid/operators/reader/create_batch_reader_op.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/design/cpp_data_feeding.md b/doc/design/cpp_data_feeding.md index a122af8cb90..22c2a925eb8 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 9559159e829..277f2856c07 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; } -- GitLab