Skip to content

Commit

Permalink
Make torch version check numeric (#4285)
Browse files Browse the repository at this point in the history
Co-authored-by: Vasilis Vryniotis <[email protected]>
  • Loading branch information
jithunnair-amd and datumbox authored Aug 17, 2021
1 parent af16236 commit f3aff2f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@ def get_extensions():
)

is_rocm_pytorch = False
if torch.__version__ >= '1.5':
TORCH_MAJOR = int(torch.__version__.split('.')[0])
TORCH_MINOR = int(torch.__version__.split('.')[1])
if TORCH_MAJOR > 1 or (TORCH_MAJOR == 1 and TORCH_MINOR >= 5):
from torch.utils.cpp_extension import ROCM_HOME
is_rocm_pytorch = True if ((torch.version.hip is not None) and (ROCM_HOME is not None)) else False

Expand Down

0 comments on commit f3aff2f

Please sign in to comment.