1818import pathlib
1919from typing import cast
2020
21+ from litert .python .aot .core import aot_types
2122from litert .python .aot .core import common
22- from litert .python .aot .core import types
2323from litert .python .aot .vendors import fallback_backend
2424from litert .python .aot .vendors .google_tensor import target as google_tensor_target
2525from litert .python .aot .vendors .mediatek import mediatek_backend
4444 </config:device-selector>"""
4545
4646
47- def _is_mobile_device_backend (backend : types .Backend ):
47+ def _is_mobile_device_backend (backend : aot_types .Backend ):
4848 """Returns True if the backend is a mobile device backend."""
4949 target = backend .target
5050 if backend .id () == qualcomm_backend .QualcommBackend .id ():
@@ -68,7 +68,7 @@ def _is_mobile_device_backend(backend: types.Backend):
6868
6969
7070def _export_model_files_to_ai_pack (
71- compiled_models : types .CompilationResult ,
71+ compiled_models : aot_types .CompilationResult ,
7272 ai_pack_dir : pathlib .Path ,
7373 ai_pack_name : str ,
7474 litert_model_name : str ,
@@ -131,7 +131,7 @@ def _export_model_files_to_ai_pack(
131131
132132
133133def _export_model_files_to_mtk_ai_pack (
134- compiled_models : types .CompilationResult ,
134+ compiled_models : aot_types .CompilationResult ,
135135 ai_pack_dir : pathlib .Path ,
136136 ai_pack_name : str ,
137137 litert_model_name : str ,
@@ -164,7 +164,7 @@ def _export_model_files_to_mtk_ai_pack(
164164 model .save (model_export_path , export_only = True )
165165
166166
167- def _build_targeting_config (compiled_backends : list [types .Backend ]) -> str :
167+ def _build_targeting_config (compiled_backends : list [aot_types .Backend ]) -> str :
168168 """Builds device-targeting-config in device_targeting_configuration.xml."""
169169 device_groups = []
170170 for backend in compiled_backends :
@@ -178,7 +178,7 @@ def _build_targeting_config(compiled_backends: list[types.Backend]) -> str:
178178 return _DEVICE_TARGETING_CONFIGURATION .format (device_groups = device_groups )
179179
180180
181- def _target_to_ai_pack_info (target : types .Target ) -> str | None :
181+ def _target_to_ai_pack_info (target : aot_types .Target ) -> str | None :
182182 """Builds the device group used in device_targeting_configuration.xml."""
183183 if isinstance (target , qnn_target .Target ):
184184 group_name = str (target )
@@ -252,7 +252,7 @@ def _process_google_tensor_target(
252252
253253
254254def _write_targeting_config (
255- compiled_models : types .CompilationResult , ai_pack_dir : pathlib .Path
255+ compiled_models : aot_types .CompilationResult , ai_pack_dir : pathlib .Path
256256) -> None :
257257 """Writes device_targeting_configuration.xml for the given compiled models."""
258258 compiled_backends = [x for x , _ in compiled_models .models_with_backend ]
@@ -265,7 +265,7 @@ def _write_targeting_config(
265265
266266
267267def export (
268- compiled_models : types .CompilationResult ,
268+ compiled_models : aot_types .CompilationResult ,
269269 ai_pack_dir : pathlib .Path | str ,
270270 ai_pack_name : str ,
271271 litert_model_name : str ,
0 commit comments