From 3741e17ca6620d6c1aad114b77836ba236604537 Mon Sep 17 00:00:00 2001 From: UltralyticsAssistant Date: Mon, 1 Jul 2024 12:25:31 +0000 Subject: [PATCH] Auto-format by https://ultralytics.com/actions --- onnxslim/onnx_graphsurgeon/ir/tensor.py | 4 ++-- onnxslim/utils.py | 11 +++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/onnxslim/onnx_graphsurgeon/ir/tensor.py b/onnxslim/onnx_graphsurgeon/ir/tensor.py index 42dd435..1557e40 100644 --- a/onnxslim/onnx_graphsurgeon/ir/tensor.py +++ b/onnxslim/onnx_graphsurgeon/ir/tensor.py @@ -172,7 +172,7 @@ def __eq__(self, other): @property def is_input(self): if hasattr(self, "_is_input"): - return self._is_input + return self._is_input return False @is_input.setter @@ -182,7 +182,7 @@ def is_input(self, is_input: bool = False): @property def is_output(self): if hasattr(self, "_is_output"): - return self._is_output + return self._is_output return False @is_output.setter diff --git a/onnxslim/utils.py b/onnxslim/utils.py index 69afee8..314d307 100644 --- a/onnxslim/utils.py +++ b/onnxslim/utils.py @@ -539,12 +539,11 @@ def check_onnx_compatibility(): "0.4": "1.5", "0.3": "1.4", "0.2": "1.3", - "0.1": "1.3" + "0.1": "1.3", } import onnx import onnxruntime - onnx_version = onnx.__version__ # ort_version = onnxruntime.__version__ ort_version = ".".join(onnxruntime.__version__.split("+")[0].split(".")[:2]) @@ -553,6 +552,10 @@ def check_onnx_compatibility(): if expected_onnx_version is None: logger.warning(f"Onnx Runtime version {ort_version} has no specified compatible ONNX version.") elif expected_onnx_version == onnx_version: - logger.info(f"Installed Onnx Runtime version {ort_version} is compatible with installed ONNX version {onnx_version}.") + logger.info( + f"Installed Onnx Runtime version {ort_version} is compatible with installed ONNX version {onnx_version}." + ) else: - print(f"Installed Onnx Runtime version {ort_version} is not compatible with installed ONNX version {onnx_version}. Expected ONNX version: {expected_onnx_version}.") + print( + f"Installed Onnx Runtime version {ort_version} is not compatible with installed ONNX version {onnx_version}. Expected ONNX version: {expected_onnx_version}." + )