Skip to content

Commit

Permalink
[ONNX][Frontend] Fix ONNX version comparison in test_forward
Browse files Browse the repository at this point in the history
  • Loading branch information
dmilosevic252 committed Dec 7, 2023
1 parent fe27973 commit 05d001c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/python/frontend/onnx/test_forward.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
from tvm.contrib import graph_executor, utils
from tvm.relay.frontend.common import infer_type
from tvm.relay.build_module import bind_params_by_name
from relay.utils.tag_span import _create_span, _set_span, _verify_structural_equal_with_span
#from relay.utils.tag_span import _create_span, _set_span, _verify_structural_equal_with_span

import onnx
import onnxruntime.backend
Expand Down Expand Up @@ -321,8 +321,8 @@ def make_constant_node(name, data_type, dims, vals):


def is_version_greater_than(ver):
return "".join(re.findall(r"(\d+\.)(\d+\.)(\d)", onnx.__version__)[0]) > "".join(
re.findall(r"(\d+\.)(\d+\.)(\d)", ver)[0]
return tuple(map(int, re.match(r"(\d+)\.(\d+)\.(\d+)", onnx.__version__).groups())) > tuple(
map(int, re.match(r"(\d+)\.(\d+)\.(\d+)", ver).groups())
)


Expand Down

0 comments on commit 05d001c

Please sign in to comment.