From e5bb3c0cb105d77dc051ce5dceaff915ccd8dda9 Mon Sep 17 00:00:00 2001 From: Jacob Szwejbka Date: Wed, 17 Apr 2024 13:20:20 -0700 Subject: [PATCH] update readme to not use exir.capture Summary: title Differential Revision: D56265239 --- backends/apple/coreml/README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backends/apple/coreml/README.md b/backends/apple/coreml/README.md index 1710860f87e..dfcad4cc3d9 100644 --- a/backends/apple/coreml/README.md +++ b/backends/apple/coreml/README.md @@ -28,6 +28,10 @@ For delegating the Program to the **Core ML** backend, the client must be respon import executorch.exir as exir import torch +from torch.export import export + +from executorch.exir import to_edge + from executorch.exir.backend.backend_api import to_backend from executorch.backends.apple.coreml.compiler import CoreMLBackend @@ -42,7 +46,7 @@ class LowerableSubModel(torch.nn.Module): # Convert the lowerable module to Edge IR Representation to_be_lowered = LowerableSubModel() example_input = (torch.ones(1), ) -to_be_lowered_exir_submodule = exir.capture(to_be_lowered, example_input).to_edge() +to_be_lowered_exir_submodule = to_edge(export(to_be_lowered, example_input)) # Lower to Core ML backend lowered_module = to_backend('CoreMLBackend', to_be_lowered_exir_submodule.exported_program, [])