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

Function export_to_edge

extension/export_util/utils.py:74–95  ·  view source on GitHub ↗
(
    model: Union[torch.fx.GraphModule, torch.nn.Module],
    example_inputs: Tuple[Value, ...],
    *,
    example_kwarg_inputs: Optional[Dict] = None,
    dynamic_shapes: Optional[Union[Dict[str, Any], Tuple[Any]]] = None,
    edge_constant_methods: Optional[Dict[str, Any]] = None,
    edge_compile_config=_EDGE_COMPILE_CONFIG,
    strict=True,
    verbose=True,
)

Source from the content-addressed store, hash-verified

72
73
74def export_to_edge(
75 model: Union[torch.fx.GraphModule, torch.nn.Module],
76 example_inputs: Tuple[Value, ...],
77 *,
78 example_kwarg_inputs: Optional[Dict] = None,
79 dynamic_shapes: Optional[Union[Dict[str, Any], Tuple[Any]]] = None,
80 edge_constant_methods: Optional[Dict[str, Any]] = None,
81 edge_compile_config=_EDGE_COMPILE_CONFIG,
82 strict=True,
83 verbose=True,
84) -> EdgeProgramManager:
85 core_aten_ep = _to_core_aten(
86 model,
87 example_inputs,
88 example_kwarg_inputs=example_kwarg_inputs,
89 dynamic_shapes=dynamic_shapes,
90 strict=strict,
91 verbose=verbose,
92 )
93 return _core_aten_to_edge(
94 core_aten_ep, edge_constant_methods, edge_compile_config, verbose=verbose
95 )
96
97
98def export_to_exec_prog(

Calls 2

_to_core_atenFunction · 0.85
_core_aten_to_edgeFunction · 0.85