Skip to content

Commit

Permalink
#0: update tensor hash
Browse files Browse the repository at this point in the history
  • Loading branch information
ntarafdar committed Jan 20, 2024
1 parent aa58e30 commit 95760b4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tt_eager/tensor/tensor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ Tensor create_sharded_device_tensor(const Shape& shape, DataType data_type, Layo

namespace std {
template <>
struct hash<Tensor> {
struct hash<tt::tt_metal::Tensor> {
std::size_t operator()(const Tensor &tensor) const {
std::size_t hash = std::hash<TensorMemoryLayout>()(tensor.memory_config().memory_layout);
hash ^= std::hash<BufferType>()(tensor.memory_config().buffer_type);
Expand Down
2 changes: 1 addition & 1 deletion tt_eager/tensor/types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ bool operator!=(const ShardSpec& spec_a, const ShardSpec& spec_b);

namespace std {
template <>
struct hash<MemoryConfig> {
struct hash<tt::tt_metal::MemoryConfig> {
std::size_t operator()(const MemoryConfig &mem_config) const {
std::size_t hash = std::hash<TensorMemoryLayout>()(mem_config.memory_layout);
hash ^= std::hash<BufferType>()(mem_config.buffer_type);
Expand Down

0 comments on commit 95760b4

Please sign in to comment.