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 Tushar Dey committed Nov 3, 2020
1 parent 38dee41 commit ebeea66
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions python/tvm/relay/frontend/pytorch_utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# pylint: disable=import-outside-toplevel
""" Common utilities used by PyTorch frontend """


def is_version_greater_than(ver):
import torch
import re

return "".join(re.findall(r"(\d+\.)(\d+\.)(\d)", torch.__version__)[0]) > "".join(
re.findall(r"(\d+\.)(\d+\.)(\d)", ver)[0]
)

0 comments on commit ebeea66

Please sign in to comment.