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

Function module_to_edge

examples/apple/coreml/scripts/inspector_utils.py:105–118  ·  view source on GitHub ↗
(
    module: torch.nn.Module,
    example_inputs: Tuple[Value, ...],
    edge_compile_config: exir.EdgeCompileConfig = _EDGE_COMPILE_CONFIG,
)

Source from the content-addressed store, hash-verified

103
104
105def module_to_edge(
106 module: torch.nn.Module,
107 example_inputs: Tuple[Value, ...],
108 edge_compile_config: exir.EdgeCompileConfig = _EDGE_COMPILE_CONFIG,
109) -> EdgeProgramManager:
110 module.eval()
111 core_aten_program = to_core_aten(
112 module=module,
113 example_inputs=example_inputs,
114 )
115 return core_aten_to_edge(
116 core_aten_program=core_aten_program,
117 edge_compile_config=edge_compile_config,
118 )
119
120
121def lower_and_export_edge_to_coreml(

Callers 1

mainFunction · 0.90

Calls 2

to_core_atenFunction · 0.85
core_aten_to_edgeFunction · 0.85

Tested by

no test coverage detected