未验证 提交 b9330fe1 编写于 作者: L Leo Chen 提交者: GitHub

add check for empty parameter desc (#56497)

上级 422a565d
...@@ -145,6 +145,10 @@ void ProgramTranslator::GetParameterForSingleBlock(const BlockDesc& block) { ...@@ -145,6 +145,10 @@ void ProgramTranslator::GetParameterForSingleBlock(const BlockDesc& block) {
bool need_get_parameter_op = is_parameter && is_unseen_variable; bool need_get_parameter_op = is_parameter && is_unseen_variable;
if (need_get_parameter_op) { if (need_get_parameter_op) {
PADDLE_ENFORCE_NOT_NULL(
var_desc,
phi::errors::PreconditionNotMet(
"VarDesc of [%s] can not be nullptr", var_name));
ir::Operation* op = InsertGetParamaterOp(ctx_, var_desc); ir::Operation* op = InsertGetParamaterOp(ctx_, var_desc);
program_->block()->push_back(op); program_->block()->push_back(op);
param_map_[var_name] = VariableDefiningInfo(op->result(0)); param_map_[var_name] = VariableDefiningInfo(op->result(0));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册