Skip to content

Commit 9b13bf0

Browse files
dbortfacebook-github-bot
authored andcommitted
Remove call to serialize_to_flatbuffer from executor_backend_preprocess
Summary: Users should use `to_executorch().buffer` instead. Reviewed By: larryliu0820 Differential Revision: D48339028 fbshipit-source-id: 720cd7370a5e3fd30e5471ee17b80d4509e418bd
1 parent fba2655 commit 9b13bf0

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

exir/backend/test/demos/rpc/executor_backend_preprocess.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
from typing import final, List
88

9-
import executorch.exir as exir
9+
from executorch.exir import ExirExportedProgram
1010
from executorch.exir.backend.backend_details import BackendDetails, ExportedProgram
1111
from executorch.exir.backend.compile_spec_schema import CompileSpec
1212

@@ -18,9 +18,12 @@ def preprocess(
1818
edge_program: ExportedProgram,
1919
compile_specs: List[CompileSpec],
2020
) -> bytes:
21-
new_prog = edge_program.transform(
22-
*exir.edge_to_executorch_passes(exir.ExecutorchBackendConfig())
21+
return (
22+
ExirExportedProgram(
23+
exported_program=edge_program,
24+
# Indicates that edge_program is already in edge dialect.
25+
after_to_edge_passes=True,
26+
)
27+
.to_executorch()
28+
.buffer
2329
)
24-
program = exir.emit_program(new_prog).program
25-
buffer = exir.serialize_to_flatbuffer(program)
26-
return buffer

0 commit comments

Comments
 (0)