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

Function RepeatedAttrDefHash

tensorflow/core/framework/op_def_util.cc:818–832  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

816}
817
818uint64 RepeatedAttrDefHash(
819 const protobuf::RepeatedPtrField<OpDef::AttrDef>& a) {
820 // Insert AttrDefs into map to deterministically sort by name
821 std::map<string, const OpDef::AttrDef*> a_set;
822 for (const OpDef::AttrDef& def : a) {
823 a_set[def.name()] = &def;
824 }
825 // Iterate and combines hashes of keys and values
826 uint64 h = 0xDECAFCAFFE;
827 for (const auto& pair : a_set) {
828 h = Hash64(pair.first.data(), pair.first.size(), h);
829 h = Hash64Combine(AttrDefHash(*pair.second), h);
830 }
831 return h;
832}
833
834bool OpDefEqual(const OpDef& o1, const OpDef& o2) {
835 // attr order doesn't matter.

Callers 3

OpDefHashFunction · 0.85
ExpectEqualFunction · 0.85
ExpectDifferentFunction · 0.85

Calls 6

Hash64CombineFunction · 0.85
AttrDefHashFunction · 0.85
nameMethod · 0.65
Hash64Function · 0.50
dataMethod · 0.45
sizeMethod · 0.45

Tested by 2

ExpectEqualFunction · 0.68
ExpectDifferentFunction · 0.68