(self)
| 185 | assert count == 1 |
| 186 | |
| 187 | def test_match_graph(self): |
| 188 | mg = ng.NNMatchGraph() |
| 189 | test2m = mg.createNode(ng.NeuralNetOperator("test2"), strict=True) |
| 190 | xm = mg.createNode(ng.NeuralNetData("X"), strict=True) |
| 191 | testm = mg.createNode(ng.NeuralNetOperator("test")) |
| 192 | mg.createEdge(test2m, xm) |
| 193 | mg.createEdge(xm, testm) |
| 194 | |
| 195 | nn = ng.NNModule() |
| 196 | test2 = nn.dataFlow.createNode(ng.NeuralNetOperator("test2")) |
| 197 | x = nn.dataFlow.createNode(ng.NeuralNetData("X")) |
| 198 | test = nn.dataFlow.createNode(ng.NeuralNetOperator("test")) |
| 199 | nn.dataFlow.createEdge(test2, x) |
| 200 | nn.dataFlow.createEdge(x, test) |
| 201 | |
| 202 | count = 0 |
| 203 | for match in nn.match(mg): |
| 204 | print(len(match)) |
| 205 | assert len(match) == 3 |
| 206 | count += 1 |
| 207 | assert count == 1 |
| 208 | |
| 209 | def test_delete_subgraph(self): |
| 210 | mg = ng.NNMatchGraph() |
nothing calls this directly
no test coverage detected