Skip to content

Commit 124bc09

Browse files
committed
fix cuda context
1 parent 2da6195 commit 124bc09

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

torch_sparse/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
f"{osp.dirname(__file__)}")
2323

2424
cuda_version = torch.ops.torch_sparse.cuda_version()
25-
if torch.cuda.is_available() and cuda_version != -1: # pragma: no cover
25+
if torch.version.cuda is not None and cuda_version != -1: # pragma: no cover
2626
if cuda_version < 10000:
2727
major, minor = int(str(cuda_version)[0]), int(str(cuda_version)[2])
2828
else:

0 commit comments

Comments
 (0)