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

Method Match

tensorflow/core/util/equal_graph_def_test.cc:54–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52 a_(GraphDefBuilder::kFailImmediately) {}
53
54 bool Match() {
55 GraphDef expected;
56 TF_EXPECT_OK(e_.ToGraphDef(&expected));
57 GraphDef actual;
58 TF_EXPECT_OK(a_.ToGraphDef(&actual));
59 bool match = EqualGraphDef(actual, expected, &diff_);
60 if (match) {
61 EXPECT_EQ(GraphDefHash(expected), GraphDefHash(actual));
62 } else {
63 // While, strictly speaking, this does not have to be the case,
64 // we want to check that our hash is more than "return 0;".
65 // If, in the extremely unlikely case, some different graphs
66 // legitimately produce equal hash values in this test, we can always
67 // tweak them a little to produce different hash values.
68 EXPECT_NE(GraphDefHash(expected), GraphDefHash(actual));
69 }
70 return match;
71 }
72
73 GraphDefBuilder e_;
74 GraphDefBuilder a_;

Callers

nothing calls this directly

Calls 3

EqualGraphDefFunction · 0.85
GraphDefHashFunction · 0.85
ToGraphDefMethod · 0.45

Tested by

no test coverage detected