From 07d38a9b9affdb68cab9fb2376cfad7f32a73fce Mon Sep 17 00:00:00 2001 From: fengjiayi Date: Mon, 19 Mar 2018 14:32:57 +0800 Subject: [PATCH] refine patch --- paddle/fluid/operators/reader/create_shuffle_reader_op.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/paddle/fluid/operators/reader/create_shuffle_reader_op.cc b/paddle/fluid/operators/reader/create_shuffle_reader_op.cc index 4ebef4aed72..3a1f3805a04 100644 --- a/paddle/fluid/operators/reader/create_shuffle_reader_op.cc +++ b/paddle/fluid/operators/reader/create_shuffle_reader_op.cc @@ -34,6 +34,9 @@ class ShuffleReader : public framework::DecoratedReader { } void ReadNext(std::vector* out) override { + if (!HasNext()) { + PADDLE_THROW("There is no next data!"); + } if (iteration_pos_ >= buffer_.size()) { VLOG(10) << "Resetting shuffle buffer"; ReadIntoBuffers(); -- GitLab