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.
scopeFix
Yiqun Liu 7 years ago committed by GitHub
parent 99acf1da4c
commit fd1971caa0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -348,8 +348,12 @@ void Executor::RunPreparedContext(ExecutorPrepareContext* ctx, Scope* scope,
}
}
}
platform::DeviceContextPool::Instance().Get(place_)->Wait();
if (create_vars && create_local_scope) {
scope->DeleteScope(local_scope);
} else {
// Delete the local scopes created in operators.
scope->DropKids();
}
if (FLAGS_benchmark) {
VLOG(2) << "-------------------------------------------------------";

Loading…
Cancel
Save