diff --git a/paddle/fluid/ir_adaptor/translator/program_translator.cc b/paddle/fluid/ir_adaptor/translator/program_translator.cc index 7eb3b57d7ad4f407f5ddeffef458a29f2d287072..3c16eebc34914a8b1ebd06d9952532dcdc33f52f 100644 --- a/paddle/fluid/ir_adaptor/translator/program_translator.cc +++ b/paddle/fluid/ir_adaptor/translator/program_translator.cc @@ -163,6 +163,11 @@ void ProgramTranslator::InsertOperationToSingleBlock(const BlockDesc& block) { auto& op_translator = OpTranslator::instance(); for (auto op : block.AllOps()) { OpTranslateFn& fn = op_translator[op->Type()]; + if (op->Type() == "shaddow_output") { + if (!param_map_.count(op->Input("x")[0])) { + continue; + } + } ir::Operation* operation = fn(ctx_, ¶m_map_, *op, program_); VLOG(10) << "[op translated][special]" << operation; } @@ -180,6 +185,10 @@ void ProgramTranslator::SetParameterFromSingleBlock(const BlockDesc& block) { need_set_parameter_op &= (param_map_.count(var_name) != 0); if (need_set_parameter_op) { ir::OpResult defining_op_result = param_map_[var_name].value; + if (!defining_op_result) { + continue; + } + ir::Operation* op = InsertSetParamaterOp( ctx_, defining_op_result, parameter_name_mappings_[var_name]);