We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4653449 commit e00f91dCopy full SHA for e00f91d
src/brevitas/export/onnx/__init__.py
@@ -1,5 +1,8 @@
1
# Copyright (C) 2023, Advanced Micro Devices, Inc. All rights reserved.
2
# SPDX-License-Identifier: BSD-3-Clause
3
+from packaging import version
4
+
5
+from brevitas import torch_version
6
7
8
def onnx_export_opset():
@@ -9,7 +12,11 @@ def onnx_export_opset():
9
12
opset = getattr(cfg, ATR_NAME)
10
13
11
14
except:
- from torch.onnx._globals import GLOBALS as cfg
15
+ if torch_version < version.parse('2.9.0'):
16
+ from torch.onnx._globals import GLOBALS as cfg
17
+ else:
18
+ from torch.onnx._internal.torchscript_exporter._globals import GLOBALS as cfg
19
20
ATR_NAME = 'export_onnx_opset_version'
21
22
0 commit comments