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

Function TEST

tensorflow/core/grappler/graph_analyzer/subgraph_test.cc:38–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36using ::testing::Ne;
37
38TEST(SubgraphTest, Comparison) {
39 GraphDef graph;
40 // A topology with a loop.
41 (*graph.add_node()) = MakeNodeConst("node1");
42 (*graph.add_node()) = MakeNodeConst("node2");
43 GenNodeMap map;
44 ASSERT_THAT(GenNode::BuildGraphInMap(graph, &map), Eq(Status::OK()));
45 auto gn1 = map["node1"].get();
46 auto gn2 = map["node2"].get();
47 ASSERT_THAT(gn1, Ne(nullptr));
48 ASSERT_THAT(gn2, Ne(nullptr));
49
50 Subgraph::Identity id1;
51 Subgraph::Identity id2;
52
53 id1.insert(gn1);
54 id2.insert(gn2);
55
56 Subgraph sg1(id1);
57 Subgraph sg2(id2);
58
59 EXPECT_TRUE(id1 == sg1.id());
60 EXPECT_TRUE(id2 == sg2.id());
61
62 EXPECT_THAT(sg1 < sg2, Eq(id1 < id2));
63}
64
65TEST(SubgraphTest, EmptyIteration) {
66 NodeDef node1 = MakeNodeConst("node1");

Callers

nothing calls this directly

Calls 15

MakeNodeConstFunction · 0.85
MakeNodeSubFunction · 0.85
sortFunction · 0.85
MakeNodeAddNFunction · 0.85
DumpLinkHashMapFunction · 0.85
DumpHashedPeerVectorFunction · 0.85
AtEndMethod · 0.80
EncodedMethod · 0.80
SkipPortMethod · 0.80
NextIfSamePortMethod · 0.80
SkipNodeMethod · 0.80

Tested by

no test coverage detected