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

Function AttrDefEqual

tensorflow/core/framework/op_def_util.cc:768–784  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

766}
767
768bool AttrDefEqual(const OpDef::AttrDef& a1, const OpDef::AttrDef& a2) {
769#ifndef TENSORFLOW_LITE_PROTOS
770 DCHECK_EQ(7, a1.GetDescriptor()->field_count())
771 << "Please modify these equality and hash functions to reflect the "
772 "changes to the AttrDef protobuf";
773#endif // TENSORFLOW_LITE_PROTOS
774
775 if (a1.name() != a2.name()) return false;
776 if (a1.type() != a2.type()) return false;
777 if (a1.description() != a2.description()) return false;
778 if (a1.has_minimum() != a2.has_minimum()) return false;
779 if (a1.has_minimum() && a1.minimum() != a2.minimum()) return false;
780 if (!AreAttrValuesEqual(a1.default_value(), a2.default_value())) return false;
781 if (!AreAttrValuesEqual(a1.allowed_values(), a2.allowed_values()))
782 return false;
783 return true;
784}
785
786uint64 AttrDefHash(const OpDef::AttrDef& a) {
787 uint64 h = Hash64(a.name());

Callers 3

RepeatedAttrDefEqualFunction · 0.85
ExpectDifferentFunction · 0.85
TESTFunction · 0.85

Calls 6

AreAttrValuesEqualFunction · 0.85
descriptionMethod · 0.80
minimumMethod · 0.80
nameMethod · 0.65
typeMethod · 0.65
default_valueMethod · 0.45

Tested by 2

ExpectDifferentFunction · 0.68
TESTFunction · 0.68