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

Function RepeatedAttrDefEqual

tensorflow/core/framework/op_def_util.cc:797–816  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

795}
796
797bool RepeatedAttrDefEqual(
798 const protobuf::RepeatedPtrField<OpDef::AttrDef>& a1,
799 const protobuf::RepeatedPtrField<OpDef::AttrDef>& a2) {
800 std::unordered_map<string, const OpDef::AttrDef*> a1_set;
801 for (const OpDef::AttrDef& def : a1) {
802 if (a1_set.find(def.name()) != a1_set.end()) {
803 LOG(ERROR) << "AttrDef names must be unique, but '" << def.name()
804 << "' appears more than once";
805 }
806 a1_set[def.name()] = &def;
807 }
808 for (const OpDef::AttrDef& def : a2) {
809 auto iter = a1_set.find(def.name());
810 if (iter == a1_set.end()) return false;
811 if (!AttrDefEqual(*iter->second, def)) return false;
812 a1_set.erase(iter);
813 }
814 if (!a1_set.empty()) return false;
815 return true;
816}
817
818uint64 RepeatedAttrDefHash(
819 const protobuf::RepeatedPtrField<OpDef::AttrDef>& a) {

Callers 3

OpDefEqualFunction · 0.85
ExpectEqualFunction · 0.85
ExpectDifferentFunction · 0.85

Calls 6

AttrDefEqualFunction · 0.85
nameMethod · 0.65
findMethod · 0.45
endMethod · 0.45
eraseMethod · 0.45
emptyMethod · 0.45

Tested by 2

ExpectEqualFunction · 0.68
ExpectDifferentFunction · 0.68