From 9b5b8cb9da51bf31ddc1f9d124c6a33f238655f8 Mon Sep 17 00:00:00 2001 From: Ritwik Das Date: Wed, 28 Oct 2020 00:57:00 -0700 Subject: [PATCH 1/5] Fix version check bug --- python/tvm/relay/frontend/pytorch_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/tvm/relay/frontend/pytorch_utils.py b/python/tvm/relay/frontend/pytorch_utils.py index e0c8f8da7d62..5081d39c85c1 100644 --- a/python/tvm/relay/frontend/pytorch_utils.py +++ b/python/tvm/relay/frontend/pytorch_utils.py @@ -22,4 +22,4 @@ def is_version_greater_than(ver): import torch from packaging import version - return version.parse(torch.__version__) > version.parse(ver) + return version.parse(''.join(re.findall('(\d+\.)(\d+\.)(\d)',torch.__version__)[0])) > version.parse(''.join(re.findall('(\d+\.)(\d+\.)(\d)',ver)[0])) From 2214454f191855a69d113a30940e6513ba673bca Mon Sep 17 00:00:00 2001 From: Ritwik Das Date: Wed, 28 Oct 2020 01:00:53 -0700 Subject: [PATCH 2/5] Update pytorch_utils.py --- python/tvm/relay/frontend/pytorch_utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/tvm/relay/frontend/pytorch_utils.py b/python/tvm/relay/frontend/pytorch_utils.py index 5081d39c85c1..160c749ca200 100644 --- a/python/tvm/relay/frontend/pytorch_utils.py +++ b/python/tvm/relay/frontend/pytorch_utils.py @@ -22,4 +22,5 @@ def is_version_greater_than(ver): import torch from packaging import version - return version.parse(''.join(re.findall('(\d+\.)(\d+\.)(\d)',torch.__version__)[0])) > version.parse(''.join(re.findall('(\d+\.)(\d+\.)(\d)',ver)[0])) + return version.parse(''.join(re.findall('(\d+\.)(\d+\.)(\d)',torch.__version__)[0])) > version.parse( + ''.join(re.findall('(\d+\.)(\d+\.)(\d)',ver)[0])) From c84c84697ef9de32eeb1ef5893e8d057be7a0e74 Mon Sep 17 00:00:00 2001 From: Ritwik Das Date: Wed, 28 Oct 2020 01:04:32 -0700 Subject: [PATCH 3/5] Update pytorch_utils.py --- python/tvm/relay/frontend/pytorch_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/tvm/relay/frontend/pytorch_utils.py b/python/tvm/relay/frontend/pytorch_utils.py index 160c749ca200..e96fb0832028 100644 --- a/python/tvm/relay/frontend/pytorch_utils.py +++ b/python/tvm/relay/frontend/pytorch_utils.py @@ -20,7 +20,7 @@ def is_version_greater_than(ver): import torch - from packaging import version + import re return version.parse(''.join(re.findall('(\d+\.)(\d+\.)(\d)',torch.__version__)[0])) > version.parse( ''.join(re.findall('(\d+\.)(\d+\.)(\d)',ver)[0])) From a83bef95e31cec93d3bc67cc4ee143018e75693c Mon Sep 17 00:00:00 2001 From: Ritwik Das Date: Wed, 28 Oct 2020 01:15:23 -0700 Subject: [PATCH 4/5] Update pytorch_utils.py --- python/tvm/relay/frontend/pytorch_utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python/tvm/relay/frontend/pytorch_utils.py b/python/tvm/relay/frontend/pytorch_utils.py index e96fb0832028..66313816813a 100644 --- a/python/tvm/relay/frontend/pytorch_utils.py +++ b/python/tvm/relay/frontend/pytorch_utils.py @@ -22,5 +22,6 @@ def is_version_greater_than(ver): import torch import re - return version.parse(''.join(re.findall('(\d+\.)(\d+\.)(\d)',torch.__version__)[0])) > version.parse( - ''.join(re.findall('(\d+\.)(\d+\.)(\d)',ver)[0])) + return "".join(re.findall("(\d+\.)(\d+\.)(\d)", torch.__version__)[0]) > "".join( + re.findall("(\d+\.)(\d+\.)(\d)", ver)[0] + ) From a0709bb2415d7fb30a81d5b7d5860d493eb46b0a Mon Sep 17 00:00:00 2001 From: Ritwik Das Date: Wed, 28 Oct 2020 01:25:17 -0700 Subject: [PATCH 5/5] Update pytorch_utils.py --- python/tvm/relay/frontend/pytorch_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/tvm/relay/frontend/pytorch_utils.py b/python/tvm/relay/frontend/pytorch_utils.py index 66313816813a..d0f0b9b4b019 100644 --- a/python/tvm/relay/frontend/pytorch_utils.py +++ b/python/tvm/relay/frontend/pytorch_utils.py @@ -22,6 +22,6 @@ def is_version_greater_than(ver): import torch import re - return "".join(re.findall("(\d+\.)(\d+\.)(\d)", torch.__version__)[0]) > "".join( - re.findall("(\d+\.)(\d+\.)(\d)", ver)[0] + return "".join(re.findall(r"(\d+\.)(\d+\.)(\d)", torch.__version__)[0]) > "".join( + re.findall(r"(\d+\.)(\d+\.)(\d)", ver)[0] )