• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) Meta Platforms, Inc. and affiliates.
2# All rights reserved.
3#
4# This source code is licensed under the BSD-style license found in the
5# LICENSE file in the root directory of this source tree.
6
7# pyre-unsafe
8
9from typing import final, List
10
11from executorch.exir.backend.backend_details import (
12    BackendDetails,
13    ExportedProgram,
14    PreprocessResult,
15)
16from executorch.exir.backend.compile_spec_schema import CompileSpec
17from executorch.exir.program._program import EdgeProgramManager
18
19
20@final
21class ExecutorBackend(BackendDetails):
22    @staticmethod
23    def preprocess(
24        edge_program: ExportedProgram,
25        compile_specs: List[CompileSpec],
26    ) -> PreprocessResult:
27        return PreprocessResult(
28            processed_bytes=EdgeProgramManager(
29                edge_programs=edge_program,
30            )
31            .to_executorch()
32            .buffer,
33        )
34