From d085f99049cdacbba3a7f33c9c1962486267222a Mon Sep 17 00:00:00 2001 From: huanghui Date: Thu, 6 Jan 2022 19:35:20 +0800 Subject: [PATCH] fix bad hash function --- mindspore/core/utils/symbolic.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mindspore/core/utils/symbolic.h b/mindspore/core/utils/symbolic.h index a076863b034..c26ca317728 100644 --- a/mindspore/core/utils/symbolic.h +++ b/mindspore/core/utils/symbolic.h @@ -78,16 +78,16 @@ class SymbolicKeyInstance : public Value { using SymbolicKeyInstancePtr = std::shared_ptr; struct SymbolicKeyInstanceHash { - std::size_t operator()(const SymbolicKeyInstancePtr s) const { + std::size_t operator()(const SymbolicKeyInstancePtr &s) const { if (s == nullptr) { return 0; } - return s->abstract()->hash(); + return s->hash(); } }; struct SymbolicKeyInstanceEqual { - bool operator()(const SymbolicKeyInstancePtr lhs, const SymbolicKeyInstancePtr rhs) const { + bool operator()(const SymbolicKeyInstancePtr &lhs, const SymbolicKeyInstancePtr &rhs) const { if (lhs == nullptr || rhs == nullptr) { return false; }