diff --git a/python/tvm/relay/frontend/pytorch_utils.py b/python/tvm/relay/frontend/pytorch_utils.py index e0c8f8da7d62..d0f0b9b4b019 100644 --- a/python/tvm/relay/frontend/pytorch_utils.py +++ b/python/tvm/relay/frontend/pytorch_utils.py @@ -20,6 +20,8 @@ def is_version_greater_than(ver): import torch - from packaging import version + import re - return version.parse(torch.__version__) > version.parse(ver) + return "".join(re.findall(r"(\d+\.)(\d+\.)(\d)", torch.__version__)[0]) > "".join( + re.findall(r"(\d+\.)(\d+\.)(\d)", ver)[0] + )