MCPcopy Create free account
hub / github.com/pytorch/executorch / _count_nodes

Method _count_nodes

exir/program/test/test_program.py:803–809  ·  view source on GitHub ↗

Count nodes in graph_module whose target matches any in targets.

(graph_module, targets)

Source from the content-addressed store, hash-verified

801
802 @staticmethod
803 def _count_nodes(graph_module, targets):
804 """Count nodes in graph_module whose target matches any in targets."""
805 count = 0
806 for node in graph_module.graph.nodes:
807 if node.op == "call_function" and node.target in targets:
808 count += 1
809 return count
810
811 def _test_to_edge_with_preserved_ops(
812 self, program, preserved_ops, expected_preserved_ops

Calls

no outgoing calls

Tested by

no test coverage detected