提交 833e522d 编写于 作者: Y Yu Yang

Enhance drop kids

上级 aba46f07
...@@ -170,8 +170,8 @@ FeedFetchList ThreadedSSAGraphExecutor::Run( ...@@ -170,8 +170,8 @@ FeedFetchList ThreadedSSAGraphExecutor::Run(
for (auto p : this->places_) { for (auto p : this->places_) {
platform::DeviceContextPool::Instance().Get(p)->Wait(); platform::DeviceContextPool::Instance().Get(p)->Wait();
} }
for (auto &drop_fn : this->drop_functions_) { for (auto &scope : local_scopes_) {
drop_fn(); scope->DropKids();
} }
}; };
...@@ -189,7 +189,6 @@ FeedFetchList ThreadedSSAGraphExecutor::Run( ...@@ -189,7 +189,6 @@ FeedFetchList ThreadedSSAGraphExecutor::Run(
// Drop tmp scopes; // Drop tmp scopes;
for (auto &scope : local_scopes_) { for (auto &scope : local_scopes_) {
auto &kid = *scope->Var("@TMP_SCOPE@")->GetMutable<Scope *>(); auto &kid = *scope->Var("@TMP_SCOPE@")->GetMutable<Scope *>();
this->drop_functions_.emplace_back([=] { scope->DeleteScope(kid); });
kid = nullptr; kid = nullptr;
} }
......
...@@ -52,7 +52,6 @@ class ThreadedSSAGraphExecutor : public SSAGraphExecutor { ...@@ -52,7 +52,6 @@ class ThreadedSSAGraphExecutor : public SSAGraphExecutor {
size_t computation_count_{0}; size_t computation_count_{0};
size_t max_async_computation{100}; size_t max_async_computation{100};
std::vector<std::function<void()>> drop_functions_;
}; };
} // namespace details } // namespace details
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册