|
6 | 6 | import collections |
7 | 7 | import gc |
8 | 8 | import os |
9 | | -import warnings |
10 | 9 |
|
11 | 10 | from coremltools import ( |
12 | | - ComputeUnit as _ComputeUnit, |
13 | | - __version__ as _ct_version, |
14 | | - _LOWEST_ALLOWED_SPECIFICATION_VERSION_FOR_NEURALNETWORK, |
15 | 11 | _LOWEST_ALLOWED_SPECIFICATION_VERSION_FOR_MILPROGRAM, |
16 | | -) |
17 | | -from coremltools.converters.mil.mil.passes.quantization_passes import ( |
18 | | - AbstractQuantizationPass, |
19 | | - ComputePrecision as precision, |
20 | | - FP16ComputePrecision |
21 | | -) |
22 | | -from coremltools.converters.mil.input_types import ( |
23 | | - ClassifierConfig, |
24 | | - ImageType, |
25 | | - InputType, |
26 | | - TensorType, |
27 | | -) |
| 12 | + _LOWEST_ALLOWED_SPECIFICATION_VERSION_FOR_NEURALNETWORK) |
| 13 | +from coremltools import ComputeUnit as _ComputeUnit |
| 14 | +from coremltools import __version__ as _ct_version |
| 15 | +from coremltools._deps import _HAS_TF_1, _HAS_TF_2, _HAS_TORCH |
| 16 | +from coremltools.converters._profile_utils import _profile |
| 17 | +from coremltools.converters.mil._deployment_compatibility import ( |
| 18 | + AvailableTarget, check_deployment_compatibility) |
28 | 19 | from coremltools.converters.mil.converter import mil_convert |
| 20 | +from coremltools.converters.mil.input_types import (ClassifierConfig, |
| 21 | + ImageType, InputType, |
| 22 | + TensorType) |
29 | 23 | from coremltools.converters.mil.mil import Program, types |
30 | | -from coremltools._deps import _HAS_TORCH, _HAS_TF_1, _HAS_TF_2 |
31 | | -from coremltools.converters._profile_utils import _profile |
32 | | - |
33 | | -from coremltools.models import _METADATA_VERSION, _METADATA_SOURCE |
| 24 | +from coremltools.converters.mil.mil.passes.quantization_passes import \ |
| 25 | + ComputePrecision as precision |
| 26 | +from coremltools.converters.mil.mil.passes.quantization_passes import \ |
| 27 | + FP16ComputePrecision |
| 28 | +from coremltools.models import _METADATA_SOURCE, _METADATA_VERSION |
34 | 29 | from coremltools.models.utils import _MLPACKAGE_EXTENSION |
35 | | -from coremltools.converters.mil._deployment_compatibility import ( |
36 | | - AvailableTarget, |
37 | | - check_deployment_compatibility, |
38 | | -) |
39 | 30 |
|
40 | 31 | if _HAS_TF_1: |
41 | 32 | import tensorflow as tf |
| 33 | + |
42 | 34 | from coremltools.converters.mil.frontend.tensorflow.load import TF1Loader |
43 | 35 | if _HAS_TF_2: |
44 | 36 | import tensorflow as tf |
| 37 | + |
45 | 38 | from coremltools.converters.mil.frontend.tensorflow2.load import TF2Loader |
46 | 39 |
|
47 | 40 | if _HAS_TORCH: |
48 | 41 | import torch |
49 | | - from coremltools.converters.mil.frontend.torch.load import ( |
50 | | - _torchscript_from_model as pytorch_load, |
51 | | - ) |
| 42 | + |
| 43 | + from coremltools.converters.mil.frontend.torch.load import \ |
| 44 | + _torchscript_from_model as pytorch_load |
52 | 45 |
|
53 | 46 | @_profile |
54 | 47 | def convert( |
|
0 commit comments