File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ import torch
2828import executorch.exir
2929
3030from executorch.backends.apple.coreml.compiler import CoreMLBackend
31- from executorch.backends.apple.coreml.partition.coreml_partitioner import CoreMLPartitioner
31+ from executorch.backends.apple.coreml.partition import CoreMLPartitioner
3232
3333class Model (torch .nn .Module ):
3434 def __init__ (self ):
@@ -72,7 +72,7 @@ from torch.ao.quantization.quantize_pt2e import (
7272 prepare_qat_pt2e,
7373)
7474
75- from executorch.backends.apple.coreml.quantizer.coreml_quantizer import CoreMLQuantizer
75+ from executorch.backends.apple.coreml.quantizer import CoreMLQuantizer
7676from coremltools.optimize.torch.quantization.quantization_config import (
7777 LinearQuantizerConfig,
7878 QuantizationScheme,
Original file line number Diff line number Diff line change 1+ # Copyright © 2023 Apple Inc. All rights reserved.
2+ #
3+ # Please refer to the license found in the LICENSE file in the root directory of the source tree.
4+
5+ from .coreml_partitioner import CoreMLPartitioner
6+
7+ __all__ = [
8+ CoreMLPartitioner ,
9+ ]
Original file line number Diff line number Diff line change 1+ # Copyright © 2023 Apple Inc. All rights reserved.
2+ #
3+ # Please refer to the license found in the LICENSE file in the root directory of the source tree.
4+
5+ from .coreml_quantizer import CoreMLQuantizer
6+
7+ __all__ = [
8+ CoreMLQuantizer ,
9+ ]
Original file line number Diff line number Diff line change 99import torch
1010import torchvision
1111
12- from executorch .backends .apple .coreml .partition .coreml_partitioner import (
13- CoreMLPartitioner ,
14- )
12+ from executorch .backends .apple .coreml .partition import CoreMLPartitioner
1513
1614
1715class TestCoreMLPartitioner (unittest .TestCase ):
Original file line number Diff line number Diff line change 1414 QuantizationScheme ,
1515)
1616
17- from executorch .backends .apple .coreml .quantizer . coreml_quantizer import CoreMLQuantizer
17+ from executorch .backends .apple .coreml .quantizer import CoreMLQuantizer
1818from torch ._export import capture_pre_autograd_graph
1919from torch .ao .quantization .quantize_pt2e import (
2020 convert_pt2e ,
Original file line number Diff line number Diff line change 1616
1717from executorch .backends .apple .coreml .compiler import CoreMLBackend
1818
19- from executorch .backends .apple .coreml .partition .coreml_partitioner import (
20- CoreMLPartitioner ,
21- )
19+ from executorch .backends .apple .coreml .partition import CoreMLPartitioner
2220from executorch .exir import to_edge
2321
2422from executorch .exir .backend .backend_api import to_backend
Original file line number Diff line number Diff line change @@ -57,16 +57,14 @@ def get_coreml_partitioner(args):
5757 args .use_kv_cache is True
5858 ), "CoreML backend currently only supports static shape and use_kv_cache=True is the only way to support it at the moment"
5959 try :
60- # pyre-ignore: Undefined import [21]: Could not find a module corresponding to import `executorch.backends.apple.coreml.partition.coreml_partitioner `.
60+ # pyre-ignore: Undefined import [21]: Could not find a module corresponding to import `coremltools `.
6161 import coremltools as ct
6262
6363 # pyre-ignore: Undefined import [21]: Could not find a module corresponding to import `executorch.backends.apple.coreml.compiler`
6464 from executorch .backends .apple .coreml .compiler import CoreMLBackend
6565
66- # pyre-ignore: Undefined import [21]: Could not find a module corresponding to import `executorch.backends.apple.coreml.partition.coreml_partitioner`
67- from executorch .backends .apple .coreml .partition .coreml_partitioner import (
68- CoreMLPartitioner ,
69- )
66+ # pyre-ignore: Undefined import [21]: Could not find a module corresponding to import `executorch.backends.apple.coreml.partition`
67+ from executorch .backends .apple .coreml .partition import CoreMLPartitioner
7068 except ImportError :
7169 raise ImportError (
7270 "Please install the CoreML backend follwing https://pytorch.org/executorch/main/build-run-coreml.html"
You can’t perform that action at this time.
0 commit comments