From 833e522d1661624662ec39da2acd1a0f8704fc70 Mon Sep 17 00:00:00 2001 From: Yu Yang Date: Tue, 27 Mar 2018 12:12:20 +0800 Subject: [PATCH] Enhance drop kids --- .../fluid/framework/details/threaded_ssa_graph_executor.cc | 5 ++--- paddle/fluid/framework/details/threaded_ssa_graph_executor.h | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/paddle/fluid/framework/details/threaded_ssa_graph_executor.cc b/paddle/fluid/framework/details/threaded_ssa_graph_executor.cc index 482c32f89..d9b855503 100644 --- a/paddle/fluid/framework/details/threaded_ssa_graph_executor.cc +++ b/paddle/fluid/framework/details/threaded_ssa_graph_executor.cc @@ -170,8 +170,8 @@ FeedFetchList ThreadedSSAGraphExecutor::Run( for (auto p : this->places_) { platform::DeviceContextPool::Instance().Get(p)->Wait(); } - for (auto &drop_fn : this->drop_functions_) { - drop_fn(); + for (auto &scope : local_scopes_) { + scope->DropKids(); } }; @@ -189,7 +189,6 @@ FeedFetchList ThreadedSSAGraphExecutor::Run( // Drop tmp scopes; for (auto &scope : local_scopes_) { auto &kid = *scope->Var("@TMP_SCOPE@")->GetMutable(); - this->drop_functions_.emplace_back([=] { scope->DeleteScope(kid); }); kid = nullptr; } diff --git a/paddle/fluid/framework/details/threaded_ssa_graph_executor.h b/paddle/fluid/framework/details/threaded_ssa_graph_executor.h index fecad00e1..14b10cd0e 100644 --- a/paddle/fluid/framework/details/threaded_ssa_graph_executor.h +++ b/paddle/fluid/framework/details/threaded_ssa_graph_executor.h @@ -52,7 +52,6 @@ class ThreadedSSAGraphExecutor : public SSAGraphExecutor { size_t computation_count_{0}; size_t max_async_computation{100}; - std::vector> drop_functions_; }; } // namespace details -- GitLab