diff --git a/mindspore/ccsrc/pipeline/pynative/pynative_execute.cc b/mindspore/ccsrc/pipeline/pynative/pynative_execute.cc index d1946e7a0d..a7abb1c5d0 100644 --- a/mindspore/ccsrc/pipeline/pynative/pynative_execute.cc +++ b/mindspore/ccsrc/pipeline/pynative/pynative_execute.cc @@ -709,7 +709,7 @@ OpExecInfoPtr ForwardExecutor::GenerateOpExecInfo(const py::args &args) { return op_exec_info; } -bool ForwardExecutor::FindOpMask(py::object obj, std::vector *op_masks, std::string id) { +bool ForwardExecutor::FindOpMask(py::object obj, std::vector *op_masks, const std::string &id) { bool op_mask = false; auto temp = op_mask_map_.find(id); if (temp != op_mask_map_.end()) { diff --git a/mindspore/ccsrc/pipeline/pynative/pynative_execute.h b/mindspore/ccsrc/pipeline/pynative/pynative_execute.h index 9c1a54d8f0..9386c87381 100644 --- a/mindspore/ccsrc/pipeline/pynative/pynative_execute.h +++ b/mindspore/ccsrc/pipeline/pynative/pynative_execute.h @@ -406,7 +406,7 @@ class ForwardExecutor { PynativeStatusCode *status); AnfNodePtr MakeCNode(const OpExecInfoPtr &op_exec_info, std::vector *op_masks, abstract::AbstractBasePtrList *args_spec_list); - bool FindOpMask(py::object obj, std::vector *op_masks, std::string id); + bool FindOpMask(py::object obj, std::vector *op_masks, const std::string &id); void GetArgsSpec(const OpExecInfoPtr &op_exec_info, std::vector *op_masks, std::vector *inputs, abstract::AbstractBasePtrList *args_spec_list); abstract::AbstractBasePtr CheckConstValue(const PrimitivePyPtr &prim, const py::object &obj,