Skip to content

Commit

Permalink
Fix version check bug (#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 Oct 28, 2020
1 parent b4858d4 commit 99027fc
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 99027fc

Please sign in to comment.