MCPcopy Create free account
hub / github.com/pytorch/pytorch / test_match_graph_node

Method test_match_graph_node

caffe2/python/nomnigraph_test.py:155–169  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

153 ng.render(nn.dataFlow)
154
155 def test_match_graph_node(self):
156 mg = ng.NNMatchGraph()
157 mg.createNode(ng.NeuralNetOperator("test"))
158 nn = ng.NNModule()
159 test = nn.dataFlow.createNode(ng.NeuralNetOperator("test"))
160 x = nn.dataFlow.createNode(ng.NeuralNetData("X"))
161 nn.dataFlow.createEdge(x, test)
162
163 count = 0
164 for match in nn.match(mg):
165 assert len(match) == 1
166 count += 1
167 # Dot generation of subgraph
168 assert(str(match).startswith("digraph G"))
169 assert count == 1
170
171 def test_match_graph_node_strict(self):
172 mg = ng.NNMatchGraph()

Callers

nothing calls this directly

Calls 3

matchMethod · 0.95
createNodeMethod · 0.80
createEdgeMethod · 0.80

Tested by

no test coverage detected