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

Function find_node_by_target

backends/mlx/test/test_pattern_utils.py:24–29  ·  view source on GitHub ↗

Find first call_function node whose target contains target_name.

(graph, target_name)

Source from the content-addressed store, hash-verified

22
23
24def find_node_by_target(graph, target_name):
25 """Find first call_function node whose target contains target_name."""
26 for node in graph.nodes:
27 if node.op == "call_function" and target_name in str(node.target):
28 return node
29 return None
30
31
32def find_all_nodes_by_target(graph, target_name):

Calls

no outgoing calls

Tested by

no test coverage detected