File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
modelopt/torch/quantization Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change 106
106
107
107
import onnx
108
108
import torch
109
- from torch .onnx import _type_utils , symbolic_helper
109
+ from packaging .version import Version
110
+
111
+ if Version (torch .__version__ ) >= Version ("2.9.0" ):
112
+ from torch .onnx ._internal .torchscript_exporter import _type_utils
113
+ else :
114
+ from torch .onnx import _type_utils
115
+
116
+ from torch .onnx import symbolic_helper
110
117
from torch .onnx import symbolic_helper as sym_help
111
118
from torch .onnx ._internal import jit_utils
112
119
from torch .onnx .symbolic_opset14 import _attention_scale , _causal_attention_mask
Original file line number Diff line number Diff line change 31
31
import torch .nn .functional as F
32
32
from packaging .version import Version
33
33
from torch import nn
34
- from torch .onnx ._internal .torchscript_exporter ._globals import GLOBALS
34
+
35
+ if Version (torch .__version__ ) >= Version ("2.9.0" ):
36
+ from torch .onnx ._internal .torchscript_exporter ._globals import GLOBALS
37
+ else :
38
+ from torch .onnx ._globals import GLOBALS
39
+
35
40
36
41
from modelopt .torch .utils import standardize_constructor_args
37
42
from modelopt .torch .utils .distributed import DistributedProcessGroup
You can’t perform that action at this time.
0 commit comments