From 71a2e6b73ccc71fa76e8b12f494cc13ead990669 Mon Sep 17 00:00:00 2001 From: Yu Yang Date: Tue, 17 Apr 2018 16:57:02 +0800 Subject: [PATCH] Reverse create var --- paddle/fluid/framework/parallel_executor.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/paddle/fluid/framework/parallel_executor.cc b/paddle/fluid/framework/parallel_executor.cc index c63162d2ff..aceb2a9def 100644 --- a/paddle/fluid/framework/parallel_executor.cc +++ b/paddle/fluid/framework/parallel_executor.cc @@ -163,7 +163,9 @@ void ParallelExecutor::Run( SplitTensorToPlaces(feed_tensors); // Create local scopes. - for (auto &scope : member_->local_scopes_) { + for (auto it = member_->local_scopes_.rbegin(); + it != member_->local_scopes_.rend(); ++it) { + auto &scope = *it; Scope &local_scope = scope->NewScope(); *scope->Var(details::kLocalExecScopeName)->GetMutable() = &local_scope; -- GitLab