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

Function TEST

tensorflow/core/grappler/utils/graph_view_internal_test.cc:55–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53using MutableNodeViewDiff = NodeViewDiff<MutableGraphView>;
54
55TEST(MutableNodeViewDiffTest, UpdateName) {
56 GraphDef graph = SimpleTestGraphForMutation();
57
58 Status s;
59 MutableGraphView graph_view(&graph, &s);
60 TF_ASSERT_OK(s);
61 auto updated_node_names = GetUpdatedNodeNames(&graph_view);
62
63 MutableNodeView* d_node = graph_view.GetNode("d");
64 ASSERT_NE(d_node, nullptr);
65
66 MutableNodeViewDiff diff(&graph_view, d_node->node_index());
67 EXPECT_TRUE(IsEmpty(&diff));
68 EXPECT_TRUE(IsWellFormed(&diff, updated_node_names));
69
70 UpdateName(&diff, "e");
71 EXPECT_FALSE(IsEmpty(&diff));
72 EXPECT_TRUE(IsWellFormed(&diff, updated_node_names));
73
74 UpdateName(&diff, "d");
75 EXPECT_TRUE(IsEmpty(&diff));
76 EXPECT_TRUE(IsWellFormed(&diff, updated_node_names));
77}
78
79TEST(MutableNodeViewDiffTest, UpdateOp) {
80 GraphDef graph = SimpleTestGraphForMutation();

Callers

nothing calls this directly

Calls 15

GetUpdatedNodeNamesFunction · 0.85
IsEmptyFunction · 0.85
IsWellFormedFunction · 0.85
UpdateNameFunction · 0.85
UpdateDeviceFunction · 0.85
AddOrUpdateRegularFaninFunction · 0.85
RemoveRegularFaninFunction · 0.85
AddControllingFaninFunction · 0.85
RemoveControllingFaninFunction · 0.85
AddOrUpdateAttributeFunction · 0.85
UpdateOpFunction · 0.70

Tested by

no test coverage detected