MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / Hash

Method Hash

tensorflow/compiler/xla/service/hlo_instruction.cc:2067–2084  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2065}
2066
2067uint64 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
2086uint64 HloInstruction::Hash() const {
2087 // Use HashOperand as an argument to prevent non-termination.

Callers

nothing calls this directly

Calls 5

Hash64CombineFunction · 0.85
HashClass · 0.50
shapeFunction · 0.50
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected