File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 1010import onnx
1111
1212from onnxscript import onnx_types
13- from onnxscript ._internal import version_utils
1413
1514# TypeAnnotationValue represents the (value of) valid type-annotations recognized
1615# by ONNX Script. TODO: Flesh out a formal definition. Currently, it supports
@@ -71,10 +70,12 @@ def onnx_attr_type_to_onnxscript_repr(attr_type: onnx.AttributeProto.AttributeTy
7170 # TODO(after onnx requirement bump): Remove this check
7271 if (
7372 not (
74- version_utils .onnx_older_than ("1.18" ) and tensor_type == onnx_types .FLOAT4E2M1
73+ not hasattr (onnx .TensorProto , "FLOAT4E2M1" )
74+ and tensor_type == onnx_types .FLOAT4E2M1
7575 )
7676 and not (
77- version_utils .onnx_older_than ("1.19" ) and tensor_type == onnx_types .FLOAT8E8M0
77+ not hasattr (onnx .TensorProto , "FLOAT8E8M0" )
78+ and tensor_type == onnx_types .FLOAT8E8M0
7879 )
7980 )
8081 )
You can’t perform that action at this time.
0 commit comments