Skip to content

Commit 77cfe4b

Browse files
authored
prevent creating cuda context on import (#282)
1 parent 1913040 commit 77cfe4b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

torch_scatter/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
torch.ops.torch_scatter.gather_coo = gather_coo_placeholder
4848

4949
cuda_version = torch.ops.torch_scatter.cuda_version()
50-
if torch.cuda.is_available() and cuda_version != -1: # pragma: no cover
50+
if torch.version.cuda is not None and cuda_version != -1: # pragma: no cover
5151
if cuda_version < 10000:
5252
major, minor = int(str(cuda_version)[0]), int(str(cuda_version)[2])
5353
else:

0 commit comments

Comments
 (0)