File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
backends/samsung/serialization Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 1111from dataclasses import dataclass
1212from enum import IntEnum , unique
1313
14- import pkg_resources
14+
15+ from importlib .resources import files
1516from executorch .exir ._serialize ._dataclass import _DataclassEncoder
1617from executorch .exir ._serialize ._flatbuffer import _flatc_compile
1718from executorch .exir .backend .backend_details import CompileSpec
@@ -36,12 +37,12 @@ def gen_samsung_backend_compile_spec_core(options: EnnExecuTorchOptions) -> Comp
3637 with tempfile .TemporaryDirectory () as d :
3738 # schema
3839 schema_path = os .path .join (d , "{}.fbs" .format (COMPILE_OPTION_SCHEMA_NAME ))
40+
41+ schema_content = files (__package__ ).joinpath (
42+ f"{ COMPILE_OPTION_SCHEMA_NAME } .fbs" ).read_bytes ()
43+
3944 with open (schema_path , "wb" ) as schema_file :
40- schema_file .write (
41- pkg_resources .resource_string (
42- __name__ , "{}.fbs" .format (COMPILE_OPTION_SCHEMA_NAME )
43- )
44- )
45+ schema_file .write (schema_content )
4546 # dump json
4647 json_path = os .path .join (d , "{}.json" .format (COMPILE_OPTION_SCHEMA_NAME ))
4748 enn_options_json = json .dumps (options , cls = _DataclassEncoder , indent = 4 )
You can’t perform that action at this time.
0 commit comments