Skip to content

Commit 65b3138

Browse files
committed
add check
1 parent 0ffd33d commit 65b3138

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

paddle/fluid/operators/detail/variable_response.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ class VariableResponse {
6868

6969
framework::Variable* InitVar() {
7070
if (use_local_scope_) {
71+
bool has_var = (scope_->FindVar(meta_.varname()) != nullptr);
72+
PADDLE_ENFORCE(has_var);
7173
return local_scope_->Var(meta_.varname());
7274
} else {
7375
return scope_->FindVar(meta_.varname());

0 commit comments

Comments
 (0)