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

Function FunctionDefsEqual

tensorflow/core/framework/function.cc:833–860  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

831} // end namespace
832
833bool FunctionDefsEqual(const FunctionDef& f1, const FunctionDef& f2) {
834 if (!OpDefEqual(f1.signature(), f2.signature())) return false;
835
836 std::map<string, AttrValue> f1_attrs = GetSetAttrs(f1);
837 std::map<string, AttrValue> f2_attrs = GetSetAttrs(f2);
838 if (f1_attrs.size() != f2_attrs.size()) return false;
839 for (auto iter1 : f1_attrs) {
840 auto iter2 = f2_attrs.find(iter1.first);
841 if (iter2 == f2_attrs.end()) return false;
842 if (!AreAttrValuesEqual(iter1.second, iter2->second)) return false;
843 }
844
845 if (!EqualRepeatedNodeDef(f1.node_def(), f2.node_def(), nullptr)) {
846 return false;
847 }
848
849 std::map<string, string> ret1(f1.ret().begin(), f1.ret().end());
850 std::map<string, string> ret2(f2.ret().begin(), f2.ret().end());
851 if (ret1 != ret2) return false;
852
853 std::map<string, string> control_ret1(f1.control_ret().begin(),
854 f1.control_ret().end());
855 std::map<string, string> control_ret2(f2.control_ret().begin(),
856 f2.control_ret().end());
857 if (control_ret1 != control_ret2) return false;
858
859 return true;
860}
861
862uint64 FunctionDefHash(const FunctionDef& fdef) {
863 // signature

Callers 9

BuildFunctionDefMethod · 0.85
ValidateAndBuildMethod · 0.85
TESTFunction · 0.85
AddFunctionDefHelperMethod · 0.85
AddHelperMethod · 0.85
CopyFunctionDefFromMethod · 0.85
AddSubgraphMethod · 0.85
TEST_FFunction · 0.85
TESTFunction · 0.85

Calls 10

OpDefEqualFunction · 0.85
GetSetAttrsFunction · 0.85
AreAttrValuesEqualFunction · 0.85
EqualRepeatedNodeDefFunction · 0.85
signatureMethod · 0.80
sizeMethod · 0.45
findMethod · 0.45
endMethod · 0.45
node_defMethod · 0.45
beginMethod · 0.45

Tested by 3

TESTFunction · 0.68
TEST_FFunction · 0.68
TESTFunction · 0.68