Skip to content

Remove dependency on exir.capture from generate_etrecord. #1002

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions sdk/etrecord/_etrecord.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ def _handle_multi_method_exported_program(
def _handle_export_module(
etrecord_zip: ZipFile,
export_module: Union[
MultiMethodExirExportedProgram, ExirExportedProgram, EdgeProgramManager
MultiMethodExirExportedProgram,
ExirExportedProgram,
EdgeProgramManager,
ExportedProgram,
],
module_name: str,
) -> None:
Expand All @@ -79,6 +82,8 @@ def _handle_export_module(
_handle_exported_program(
etrecord_zip, module_name, "forward", export_module.exported_program
)
elif isinstance(export_module, ExportedProgram):
_handle_exported_program(etrecord_zip, module_name, "forward", export_module)
elif isinstance(
export_module,
(EdgeProgramManager, exir.program._program.EdgeProgramManager),
Expand Down Expand Up @@ -140,7 +145,7 @@ def generate_etrecord(
executorch_program: `ExecutorchProgramManager` for this model returned by the call to `to_executorch()`
export_modules[Optional]: **Should be ignored by OSS users**. A dictionary of graph modules with the key being the user provided name and the
value being the corresponding exported module. The exported graph modules can be either the
output of `capture()` or `to_edge()`.
output of `torch.export()` or `exir.to_edge()`.

Returns:
None
Expand Down