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

Function _get_submodule

exir/graph_module.py:39–48  ·  view source on GitHub ↗
(
    graph_module: torch.fx.GraphModule, node: torch.fx.Node, arg_index: int
)

Source from the content-addressed store, hash-verified

37
38
39def _get_submodule(
40 graph_module: torch.fx.GraphModule, node: torch.fx.Node, arg_index: int
41) -> Tuple[str, torch.nn.Module, torch.fx.Node]:
42 submod_node = node.args[arg_index]
43 assert isinstance(submod_node, torch.fx.Node)
44 assert submod_node.op == "get_attr"
45 assert isinstance(submod_node.target, str)
46 submodule = graph_module.get_submodule(submod_node.target)
47 # pyre-ignore
48 return submod_node.target, submodule, node
49
50
51def _get_control_flow_submodules(

Callers 3

get_lowered_submodulesFunction · 0.90
processMethod · 0.90

Calls 1

get_submoduleMethod · 0.80

Tested by 1

processMethod · 0.72