未验证 提交 fd1971ca 编写于 作者: Y Yiqun Liu 提交者: GitHub

Add the call of DropKids at the end of executor.Run to delete the local scopes...

Add the call of DropKids at the end of executor.Run to delete the local scopes created in operators (#10403)

* Add the call of DeleteScope to delete the memory of scope created by NewScope.

* Call DropKids at the end of executor.Run to delete all local scopes created in operators.
上级 99acf1da
...@@ -348,8 +348,12 @@ void Executor::RunPreparedContext(ExecutorPrepareContext* ctx, Scope* scope, ...@@ -348,8 +348,12 @@ void Executor::RunPreparedContext(ExecutorPrepareContext* ctx, Scope* scope,
} }
} }
} }
platform::DeviceContextPool::Instance().Get(place_)->Wait();
if (create_vars && create_local_scope) { if (create_vars && create_local_scope) {
scope->DeleteScope(local_scope); scope->DeleteScope(local_scope);
} else {
// Delete the local scopes created in operators.
scope->DropKids();
} }
if (FLAGS_benchmark) { if (FLAGS_benchmark) {
VLOG(2) << "-------------------------------------------------------"; VLOG(2) << "-------------------------------------------------------";
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册