From 3526ac1136eb51decb567b4cd0230ac9bae5c244 Mon Sep 17 00:00:00 2001 From: fengjiayi Date: Mon, 4 Jun 2018 15:35:06 +0800 Subject: [PATCH] refine code --- paddle/fluid/operators/reader/open_files_op.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/paddle/fluid/operators/reader/open_files_op.cc b/paddle/fluid/operators/reader/open_files_op.cc index 2cbae8a90a9..31e5d81e55e 100644 --- a/paddle/fluid/operators/reader/open_files_op.cc +++ b/paddle/fluid/operators/reader/open_files_op.cc @@ -63,9 +63,6 @@ void MultiFileReader::ReadNext(std::vector* out) { void MultiFileReader::ReInit() { EndScheduler(); - for (auto& reader : readers_) { - reader->ReInit(); - } StartNewScheduler(); } @@ -141,6 +138,7 @@ void MultiFileReader::PrefetchThreadFunc(size_t reader_idx, size_t thread_idx) { std::vector ins; reader->ReadNext(&ins); if (ins.empty()) { + reader->ReInit(); break; } try { -- GitLab