From ff41ea70bbea05298e291ceb3a863a7ca1d859a3 Mon Sep 17 00:00:00 2001 From: Ritwik Das Date: Wed, 28 Oct 2020 06:05:47 -0700 Subject: [PATCH] Fix version check bug (#6784) * Fix version check bug * Update pytorch_utils.py * Update pytorch_utils.py * Update pytorch_utils.py * Update pytorch_utils.py --- python/tvm/relay/frontend/pytorch_utils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/python/tvm/relay/frontend/pytorch_utils.py b/python/tvm/relay/frontend/pytorch_utils.py index e0c8f8da7d62f..d0f0b9b4b0190 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] + )