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

Function TEST

tensorflow/core/grappler/mutable_graph_view_test.cc:144–170  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

142}
143
144TEST(MutableGraphViewTest, AddSubgraph) {
145 GraphDef graph_def = test::function::GDef(
146 {
147 NDef("foo", "NotImportant", {}, {}),
148 NDef("bar", "NotImportant", {}, {}),
149 NDef("baz", "NotImportant", {"foo", "bar"}),
150 },
151 /*funcs=*/{});
152 MutableGraphView graph(&graph_def);
153
154 // `s/bar` node has inputs that are valid only if we add subgraph into the
155 // original graph.
156 GraphDef subgraph = test::function::GDef(
157 {
158 NDef("s/n0", "NotImportant", {}, {}),
159 NDef("s/n1", "NotImportant", {"bar", "s/n0"}, {}),
160 },
161 /*funcs=*/{});
162
163 TF_EXPECT_OK(graph.AddSubgraph(std::move(subgraph)));
164
165 // Fanins and fanouts must be updated for the nodes of the original graph, and
166 // added subgraph.
167 CheckNode(graph, "bar", "NotImportant", "", {}, {}, {"baz:1", "s/n1"});
168 CheckNode(graph, "s/n1", "NotImportant", "", {}, {"bar", "s/n0"}, {});
169 CheckGraph(graph);
170}
171
172TEST(MutableGraphViewTest, AddSubgraphAndAddFunction) {
173 GraphDef graph_def;

Callers

nothing calls this directly

Calls 15

GDefFunction · 0.85
NDefFunction · 0.85
CheckNodeFunction · 0.85
CheckGraphFunction · 0.85
XTimesTwoFunction · 0.85
XTimesFourFunction · 0.85
TestUpdateNodeNameFunction · 0.85
TestSwapNodeNamesFunction · 0.85
TestSwapNodeNamesErrorFunction · 0.85

Tested by

no test coverage detected