| 2065 | } |
| 2066 | |
| 2067 | uint64 HloInstruction::Hash( |
| 2068 | const std::function<uint64(const HloInstruction*)>& hash_operand) const { |
| 2069 | using tensorflow::Hash64Combine; |
| 2070 | |
| 2071 | uint64 hash_value = Hash64Combine(0, static_cast<uint64>(opcode())); |
| 2072 | hash_value = Hash64Combine(hash_value, ShapeUtil::Hash(shape())); |
| 2073 | |
| 2074 | if (!IsCrossModuleAllReduce()) { |
| 2075 | if (!operands().empty()) { |
| 2076 | for (size_t i = 0; i < operands().size(); ++i) { |
| 2077 | hash_value = Hash64Combine(hash_value, hash_operand(operand(i))); |
| 2078 | } |
| 2079 | } |
| 2080 | } |
| 2081 | |
| 2082 | hash_value = Hash64Combine(hash_value, InnerHash()); |
| 2083 | return hash_value; |
| 2084 | } |
| 2085 | |
| 2086 | uint64 HloInstruction::Hash() const { |
| 2087 | // Use HashOperand as an argument to prevent non-termination. |
nothing calls this directly
no test coverage detected