diff --git a/ethosu/regor/common/shape.hpp b/ethosu/regor/common/shape.hpp index 74293bae2f4aedc9e4ffd8afa2d68c19da8d71bc..b2ce928e5540aec510af39b2ed21fffa66ae9849 100644 --- a/ethosu/regor/common/shape.hpp +++ b/ethosu/regor/common/shape.hpp @@ -189,7 +189,16 @@ public: return true; } - explicit operator uint32_t() const { return At(0) ^ (At(1) << 8) ^ (At(2) << 16) ^ (At(3) << 24); } + explicit operator uint32_t() const + { + uint32_t hash = 0; + auto *local = Storage(); + for ( int i = 0; i <= _last; i++ ) + { + hash = hash * 31 + local[i]; + } + return hash; + } explicit operator uint64_t() const { return uint64_t(uint32_t(*this)); }