File tree 2 files changed +11
-2
lines changed
optimum/intel/neural_compressor
2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 28
28
from neural_compressor .model .onnx_model import ONNXModel
29
29
from neural_compressor .model .torch_model import IPEXModel , PyTorchModel
30
30
from neural_compressor .quantization import fit
31
- from neural_compressor .utils .export import torch_to_int8_onnx
32
31
from packaging .version import parse
33
32
from torch .utils .data import DataLoader , RandomSampler
34
33
from transformers import (
80
79
)
81
80
82
81
82
+ if is_neural_compressor_version ("<" , "2.6" ):
83
+ from neural_compressor .experimental .export import torch_to_int8_onnx
84
+ else :
85
+ from neural_compressor .utils .export import torch_to_int8_onnx
86
+
87
+
83
88
if is_itrex_available ():
84
89
if is_itrex_version ("<" , ITREX_MINIMUM_VERSION ):
85
90
raise ImportError (
Original file line number Diff line number Diff line change 36
36
from neural_compressor import training
37
37
from neural_compressor .compression import DistillationCallbacks
38
38
from neural_compressor .conf .pythonic_config import _BaseQuantizationConfig
39
- from neural_compressor .utils .export import torch_to_fp32_onnx , torch_to_int8_onnx
40
39
from packaging import version
41
40
from torch import nn
42
41
from torch .utils .data import Dataset , RandomSampler
107
106
if TYPE_CHECKING :
108
107
from optimum .exporters .onnx import OnnxConfig
109
108
109
+ if is_neural_compressor_version ("<" , "2.6" ):
110
+ from neural_compressor .experimental .export import torch_to_fp32_onnx , torch_to_int8_onnx
111
+ else :
112
+ from neural_compressor .utils .export import torch_to_fp32_onnx , torch_to_int8_onnx
113
+
110
114
111
115
__version__ = "4.22.2"
112
116
You can’t perform that action at this time.
0 commit comments