Skip to content

Commit

Permalink
Fix version check bug (apache#6784)
Browse files Browse the repository at this point in the history
* Fix version check bug

* Update pytorch_utils.py

* Update pytorch_utils.py

* Update pytorch_utils.py

* Update pytorch_utils.py
  • Loading branch information
codeislife99 authored and Trevor Morris committed Dec 2, 2020
1 parent 23e9452 commit 9c96ad6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions python/tvm/relay/frontend/pytorch_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
)

0 comments on commit 9c96ad6

Please sign in to comment.