File tree 7 files changed +26
-14
lines changed
7 files changed +26
-14
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ import torch
28
28
import executorch.exir
29
29
30
30
from 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
32
32
33
33
class Model (torch .nn .Module ):
34
34
def __init__ (self ):
@@ -72,7 +72,7 @@ from torch.ao.quantization.quantize_pt2e import (
72
72
prepare_qat_pt2e,
73
73
)
74
74
75
- from executorch.backends.apple.coreml.quantizer.coreml_quantizer import CoreMLQuantizer
75
+ from executorch.backends.apple.coreml.quantizer import CoreMLQuantizer
76
76
from coremltools.optimize.torch.quantization.quantization_config import (
77
77
LinearQuantizerConfig,
78
78
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 9
9
import torch
10
10
import torchvision
11
11
12
- from executorch .backends .apple .coreml .partition .coreml_partitioner import (
13
- CoreMLPartitioner ,
14
- )
12
+ from executorch .backends .apple .coreml .partition import CoreMLPartitioner
15
13
16
14
17
15
class TestCoreMLPartitioner (unittest .TestCase ):
Original file line number Diff line number Diff line change 14
14
QuantizationScheme ,
15
15
)
16
16
17
- from executorch .backends .apple .coreml .quantizer . coreml_quantizer import CoreMLQuantizer
17
+ from executorch .backends .apple .coreml .quantizer import CoreMLQuantizer
18
18
from torch ._export import capture_pre_autograd_graph
19
19
from torch .ao .quantization .quantize_pt2e import (
20
20
convert_pt2e ,
Original file line number Diff line number Diff line change 16
16
17
17
from executorch .backends .apple .coreml .compiler import CoreMLBackend
18
18
19
- from executorch .backends .apple .coreml .partition .coreml_partitioner import (
20
- CoreMLPartitioner ,
21
- )
19
+ from executorch .backends .apple .coreml .partition import CoreMLPartitioner
22
20
from executorch .exir import to_edge
23
21
24
22
from 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):
57
57
args .use_kv_cache is True
58
58
), "CoreML backend currently only supports static shape and use_kv_cache=True is the only way to support it at the moment"
59
59
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 `.
61
61
import coremltools as ct
62
62
63
63
# pyre-ignore: Undefined import [21]: Could not find a module corresponding to import `executorch.backends.apple.coreml.compiler`
64
64
from executorch .backends .apple .coreml .compiler import CoreMLBackend
65
65
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
70
68
except ImportError :
71
69
raise ImportError (
72
70
"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