diff --git a/mindspore/ccsrc/cxx_api/model/acl/acl_model_multi.cc b/mindspore/ccsrc/cxx_api/model/acl/acl_model_multi.cc index 59cdf3b4349..22d88349a31 100644 --- a/mindspore/ccsrc/cxx_api/model/acl/acl_model_multi.cc +++ b/mindspore/ccsrc/cxx_api/model/acl/acl_model_multi.cc @@ -92,14 +92,12 @@ class MSTensorRef : public BaseRef { if (!utils::isa(other)) { return false; } - return *this == utils::cast(other); - } - - bool operator==(MSTensorRef &other) { - return (ms_tensor_.Name() == other.ms_tensor_.Name()) && (ms_tensor_.Shape() == other.ms_tensor_.Shape()) && - (ms_tensor_.MutableData() == other.ms_tensor_.MutableData()) && - (ms_tensor_.DataSize() == other.ms_tensor_.DataSize()) && - (ms_tensor_.DataType() == other.ms_tensor_.DataType()); + auto other_ms_tensor = utils::cast(other).ms_tensor_; + auto this_ms_tensor = ms_tensor_; + return (this_ms_tensor.Name() == other_ms_tensor.Name()) && (this_ms_tensor.Shape() == other_ms_tensor.Shape()) && + (this_ms_tensor.MutableData() == other_ms_tensor.MutableData()) && + (this_ms_tensor.DataSize() == other_ms_tensor.DataSize()) && + (this_ms_tensor.DataType() == other_ms_tensor.DataType()); } private: