Skip to content

Commit f8c2742

Browse files
Varun Purifacebook-github-bot
authored andcommitted
Remove dependency on exir.capture from generate_etrecord. (#1002)
Summary: Pull Request resolved: #1002 exir.capture is deprecated. Update etrecord.bin to align with new serialization schema Deprecation warning will still trigger at runtime due to `executorch.exir.tests.models` import. Reviewed By: Jack-Khuu Differential Revision: D50378335 fbshipit-source-id: e8511f6ed91dab84a600ff70077b73f909dd551b
1 parent 8967271 commit f8c2742

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

sdk/etrecord/_etrecord.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,10 @@ def _handle_multi_method_exported_program(
6969
def _handle_export_module(
7070
etrecord_zip: ZipFile,
7171
export_module: Union[
72-
MultiMethodExirExportedProgram, ExirExportedProgram, EdgeProgramManager
72+
MultiMethodExirExportedProgram,
73+
ExirExportedProgram,
74+
EdgeProgramManager,
75+
ExportedProgram,
7376
],
7477
module_name: str,
7578
) -> None:
@@ -79,6 +82,8 @@ def _handle_export_module(
7982
_handle_exported_program(
8083
etrecord_zip, module_name, "forward", export_module.exported_program
8184
)
85+
elif isinstance(export_module, ExportedProgram):
86+
_handle_exported_program(etrecord_zip, module_name, "forward", export_module)
8287
elif isinstance(
8388
export_module,
8489
(EdgeProgramManager, exir.program._program.EdgeProgramManager),
@@ -140,7 +145,7 @@ def generate_etrecord(
140145
executorch_program: `ExecutorchProgramManager` for this model returned by the call to `to_executorch()`
141146
export_modules[Optional]: **Should be ignored by OSS users**. A dictionary of graph modules with the key being the user provided name and the
142147
value being the corresponding exported module. The exported graph modules can be either the
143-
output of `capture()` or `to_edge()`.
148+
output of `torch.export()` or `exir.to_edge()`.
144149
145150
Returns:
146151
None

0 commit comments

Comments
 (0)