From c9ad820628782aeae807109fe227a405c5056095 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?xavier=20dupr=C3=A9?= Date: Tue, 29 Dec 2020 01:36:05 +0100 Subject: [PATCH 1/3] add Float16TensorType MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xavier dupré --- onnxconverter_common/data_types.py | 11 +++++++++++ tests/test_data_types.py | 2 ++ 2 files changed, 13 insertions(+) diff --git a/onnxconverter_common/data_types.py b/onnxconverter_common/data_types.py index bc5debe..b6e3342 100644 --- a/onnxconverter_common/data_types.py +++ b/onnxconverter_common/data_types.py @@ -154,6 +154,17 @@ def _get_element_onnx_type(self): return onnx_proto.TensorProto.FLOAT +class Float16TensorType(TensorType): + def __init__(self, shape=None, color_space=None, doc_string='', + denotation=None, channel_denotations=None): + super(Float16TensorType, self).__init__(shape, doc_string, denotation, + channel_denotations) + self.color_space = color_space + + def _get_element_onnx_type(self): + return onnx_proto.TensorProto.FLOAT16 + + class DoubleTensorType(TensorType): def __init__(self, shape=None, color_space=None, doc_string=''): super(DoubleTensorType, self).__init__(shape, doc_string) diff --git a/tests/test_data_types.py b/tests/test_data_types.py index bb6f9e2..393b044 100644 --- a/tests/test_data_types.py +++ b/tests/test_data_types.py @@ -15,6 +15,7 @@ Int8TensorType, FloatType, FloatTensorType, + Float16TensorType, SequenceType, StringType, StringTensorType, @@ -40,6 +41,7 @@ def test_tensor_type(self): Int64TensorType, Int8TensorType, FloatTensorType, + Float16TensorType, StringTensorType, UInt8TensorType, ] From 44adb33563de45b46a0beec645b557f768af25c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?xavier=20dupr=C3=A9?= Date: Tue, 29 Dec 2020 01:39:44 +0100 Subject: [PATCH 2/3] Revert "add Float16TensorType" This reverts commit 401f49cc906dcbfb2201efa1d7b804be90c50fef. --- onnxconverter_common/data_types.py | 11 ----------- tests/test_data_types.py | 2 -- 2 files changed, 13 deletions(-) diff --git a/onnxconverter_common/data_types.py b/onnxconverter_common/data_types.py index b6e3342..bc5debe 100644 --- a/onnxconverter_common/data_types.py +++ b/onnxconverter_common/data_types.py @@ -154,17 +154,6 @@ def _get_element_onnx_type(self): return onnx_proto.TensorProto.FLOAT -class Float16TensorType(TensorType): - def __init__(self, shape=None, color_space=None, doc_string='', - denotation=None, channel_denotations=None): - super(Float16TensorType, self).__init__(shape, doc_string, denotation, - channel_denotations) - self.color_space = color_space - - def _get_element_onnx_type(self): - return onnx_proto.TensorProto.FLOAT16 - - class DoubleTensorType(TensorType): def __init__(self, shape=None, color_space=None, doc_string=''): super(DoubleTensorType, self).__init__(shape, doc_string) diff --git a/tests/test_data_types.py b/tests/test_data_types.py index 393b044..bb6f9e2 100644 --- a/tests/test_data_types.py +++ b/tests/test_data_types.py @@ -15,7 +15,6 @@ Int8TensorType, FloatType, FloatTensorType, - Float16TensorType, SequenceType, StringType, StringTensorType, @@ -41,7 +40,6 @@ def test_tensor_type(self): Int64TensorType, Int8TensorType, FloatTensorType, - Float16TensorType, StringTensorType, UInt8TensorType, ] From b31440b67856dd85e379561d8ed0ea36cd82ac4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?xavier=20dupr=C3=A9?= Date: Mon, 4 Oct 2021 12:26:39 +0200 Subject: [PATCH 3/3] Increase max supported opset MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xavier dupré --- onnxconverter_common/__init__.py | 2 +- onnxconverter_common/onnx_ex.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/onnxconverter_common/__init__.py b/onnxconverter_common/__init__.py index c5475f4..f4d0b81 100644 --- a/onnxconverter_common/__init__.py +++ b/onnxconverter_common/__init__.py @@ -8,7 +8,7 @@ This framework performs optimization for ONNX models and includes common utilities for ONNX converters. """ -__version__ = "1.9.0" +__version__ = "1.10.0" __author__ = "Microsoft" __producer__ = "OnnxMLTools" __producer_version__ = __version__ diff --git a/onnxconverter_common/onnx_ex.py b/onnxconverter_common/onnx_ex.py index 86146c5..c7f372f 100644 --- a/onnxconverter_common/onnx_ex.py +++ b/onnxconverter_common/onnx_ex.py @@ -8,12 +8,12 @@ from . import utils from .metadata_props import add_metadata_props -DEFAULT_OPSET_NUMBER = 14 # The maximum opset supported by the converter in the code branch. +DEFAULT_OPSET_NUMBER = 15 # The maximum opset supported by the converter in the code branch. # From https://github.com/onnx/onnx/blob/master/docs/Versioning.md OPSET_TO_IR_VERSION = { 1: 3, 2: 3, 3: 3, 4: 3, 5: 3, 6: 3, 7: 3, 8: 3, 9: 4, 10: 5, 11: 6, 12: 7, - 13: 7, 14: 7 + 13: 7, 14: 7, 15: 8 }