提交 65b3138e 编写于 作者: Q qiaolongfei

add check

上级 0ffd33d3
...@@ -68,6 +68,8 @@ class VariableResponse { ...@@ -68,6 +68,8 @@ class VariableResponse {
framework::Variable* InitVar() { framework::Variable* InitVar() {
if (use_local_scope_) { if (use_local_scope_) {
bool has_var = (scope_->FindVar(meta_.varname()) != nullptr);
PADDLE_ENFORCE(has_var);
return local_scope_->Var(meta_.varname()); return local_scope_->Var(meta_.varname());
} else { } else {
return scope_->FindVar(meta_.varname()); return scope_->FindVar(meta_.varname());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册