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

Function is_submodule_node

backends/arm/_passes/arm_pass_utils.py:42–49  ·  view source on GitHub ↗
(node: torch.fx.Node)

Source from the content-addressed store, hash-verified

40
41
42def is_submodule_node(node: torch.fx.Node):
43 if node.op not in ("get_attr", "placeholder"):
44 return False
45 try:
46 node.graph.owning_module.get_submodule(node.target)
47 except AttributeError:
48 return False
49 return True
50
51
52def is_get_attr_node(node: torch.fx.Node) -> bool:

Callers 8

_convert_getattrMethod · 0.90
is_node_supportedMethod · 0.90
is_node_supportedMethod · 0.90
is_node_supportedMethod · 0.90
is_node_supportedMethod · 0.90
is_node_supportedMethod · 0.90
is_get_attr_nodeFunction · 0.85

Calls 1

get_submoduleMethod · 0.80

Tested by

no test coverage detected