We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 28557e0 commit 59c4de9Copy full SHA for 59c4de9
torchvision/extension.py
@@ -47,19 +47,18 @@ def _check_cuda_version():
47
"""
48
if not _HAS_OPS:
49
return -1
50
- import torch
+ from torch.version import cuda as torch_version_cuda
51
52
_version = torch.ops.torchvision._cuda_version()
53
- if _version != -1 and torch.version.cuda is not None:
+ if _version != -1 and torch_version_cuda is not None:
54
tv_version = str(_version)
55
if int(tv_version) < 10000:
56
tv_major = int(tv_version[0])
57
tv_minor = int(tv_version[2])
58
else:
59
tv_major = int(tv_version[0:2])
60
tv_minor = int(tv_version[3])
61
- t_version = torch.version.cuda
62
- t_version = t_version.split(".")
+ t_version = torch_version_cuda.split(".")
63
t_major = int(t_version[0])
64
t_minor = int(t_version[1])
65
if t_major != tv_major or t_minor != tv_minor:
0 commit comments