diff --git a/mindspore/ccsrc/pipeline/pynative/pynative_utils.cc b/mindspore/ccsrc/pipeline/pynative/pynative_utils.cc index 0bc523f431d..db0c56abaab 100644 --- a/mindspore/ccsrc/pipeline/pynative/pynative_utils.cc +++ b/mindspore/ccsrc/pipeline/pynative/pynative_utils.cc @@ -496,6 +496,10 @@ void DataConvert::GetInputTensor(const FrontendOpRunInfoPtr &op_run_info, const if (need_convert_input_to_attr) { // Clone a new prim op_run_info->op_prim = std::make_shared(*(op_run_info->op_prim)); + MS_EXCEPTION_IF_NULL(op_run_info->op_prim->adapter()); + if (op_run_info->op_prim->adapter()->attached_primitive() == nullptr) { + op_run_info->op_prim->adapter()->set_attached_primitive(op_run_info->op_prim); + } } const auto &op_prim = op_run_info->op_prim;