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

Function get_lowered_submodules

exir/lowered_backend_module.py:929–944  ·  view source on GitHub ↗

Returns a list of lowered modules that are in the given graph (does not look into submodules). Specifically, the returned value is a list containing a tuple of (name of the lowered module that's stored in the graph module, the lowered module itself, and the fx node that called this

(
    graph_module: torch.fx.GraphModule,
)

Source from the content-addressed store, hash-verified

927
928
929def get_lowered_submodules(
930 graph_module: torch.fx.GraphModule,
931) -> List[Tuple[str, LoweredBackendModule, torch.fx.Node]]:
932 """
933 Returns a list of lowered modules that are in the given graph (does not look
934 into submodules). Specifically, the returned value is a list containing a
935 tuple of (name of the lowered module that's stored in the graph module, the
936 lowered module itself, and the fx node that called this lowered module).
937 """
938 lowered_submodules = []
939 for node in graph_module.graph.nodes:
940 if node.op == "call_function" and node.target == executorch_call_delegate:
941 name, module, node = _get_submodule(graph_module, node, 0)
942 assert isinstance(module, LoweredBackendModule)
943 lowered_submodules.append((name, module, node))
944 return lowered_submodules
945
946
947def get_lowered_backend_modules(

Calls 2

_get_submoduleFunction · 0.90
appendMethod · 0.45