From b8029fd650f635a60e773ad57d2b6df522772a86 Mon Sep 17 00:00:00 2001 From: yuyang18 Date: Mon, 20 Aug 2018 10:10:23 +0800 Subject: [PATCH] Follow comments --- .../details/fast_threaded_ssa_graph_executor.cc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/paddle/fluid/framework/details/fast_threaded_ssa_graph_executor.cc b/paddle/fluid/framework/details/fast_threaded_ssa_graph_executor.cc index 227a366f22..7606f2bc06 100644 --- a/paddle/fluid/framework/details/fast_threaded_ssa_graph_executor.cc +++ b/paddle/fluid/framework/details/fast_threaded_ssa_graph_executor.cc @@ -101,9 +101,15 @@ FeedFetchList FastThreadedSSAGraphExecutor::Run( while (num_complete != op_deps->size()) { size_t num_comp = complete_q.Pop(); if (num_comp == -1UL) { - int remaining = remaining_; - for (int i = 0; i < remaining; ++i) { - complete_q.Pop(); + int remaining = 0; + while (true) { + remaining = remaining_; + if (remaining == 0) { + break; + } + for (int i = 0; i < remaining; ++i) { + complete_q.Pop(); + } } exception_.ReThrow(); } -- GitLab