Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
UltralyticsAssistant committed Jul 1, 2024
1 parent 2898ae7 commit 3741e17
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions onnxslim/onnx_graphsurgeon/ir/tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
11 changes: 7 additions & 4 deletions onnxslim/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand All @@ -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}."
)

0 comments on commit 3741e17

Please sign in to comment.