We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5032656 commit 4375204Copy full SHA for 4375204
paddle/fluid/framework/details/scope_buffered_ssa_graph_executor.cc
@@ -65,11 +65,14 @@ void ScopeBufferedSSAGraphExecutor::DropLocalExeScopes() {
65
for (auto p : places_) {
66
platform::DeviceContextPool::Instance().Get(p)->Wait();
67
}
68
+
69
for (auto &scope : local_scopes_) {
- auto &local_scope =
70
- *scope->Var(details::kLocalExecScopeName)->GetMutable<Scope *>();
71
- scope->DeleteScope(local_scope);
72
- VLOG(3) << "Drop local execution scope: " << local_scope;
+ auto *local_scope_var = scope->FindLocalVar(details::kLocalExecScopeName);
+ if (local_scope_var != nullptr) {
+ auto &local_scope = *local_scope_var->GetMutable<Scope *>();
73
+ scope->DeleteScope(local_scope);
74
+ VLOG(3) << "Drop local execution scope: " << local_scope;
75
+ }
76
77
78
0 commit comments