Skip to content

Commit

Permalink
Make torch version check numeric
Browse files Browse the repository at this point in the history
  • Loading branch information
jithunnair-amd committed Aug 17, 2021
1 parent 2c52d9f commit 411b1f8
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 @@ -145,7 +145,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 411b1f8

Please sign in to comment.