Skip to content

Commit 8ca6d86

Browse files
committed
doc fix
1 parent 9c1f401 commit 8ca6d86

File tree

5 files changed

+10
-17
lines changed

5 files changed

+10
-17
lines changed

docs/requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
-f https://download.pytorch.org/whl/torch_stable.html
21
numpy
32
https://download.pytorch.org/whl/cpu/torch-1.4.0%2Bcpu-cp37-cp37m-linux_x86_64.whl
43
sphinx

torch_scatter/__init__.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,19 @@
2222
f'version {major}.{minor}.')
2323
raise OSError(e)
2424
except AttributeError as e:
25-
if os.getenv('BUILD_DOCS', '0') == '1':
26-
pass
27-
else:
25+
if os.getenv('BUILD_DOCS', '0') != '1':
2826
raise AttributeError(e)
2927

30-
cuda_version = torch.ops.torch_scatter.cuda_version()
31-
if cuda_version != -1 and torch.version.cuda is not None: # pragma: no cover
32-
if cuda_version < 10000:
28+
if torch.version.cuda is not None: # pragma: no cover
29+
cuda_version = torch.ops.torch_scatter.cuda_version()
30+
31+
if cuda_version == -1:
32+
major = minor = 0
33+
elif cuda_version < 10000:
3334
major, minor = int(str(cuda_version)[0]), int(str(cuda_version)[2])
3435
else:
3536
major, minor = int(str(cuda_version)[0:2]), int(str(cuda_version)[3])
3637
t_major, t_minor = [int(x) for x in torch.version.cuda.split('.')]
37-
cuda_version = str(major) + '.' + str(minor)
3838

3939
if t_major != major or t_minor != minor:
4040
raise RuntimeError(

torch_scatter/scatter.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111
torch.ops.load_library(importlib.machinery.PathFinder().find_spec(
1212
'_scatter', [osp.dirname(__file__)]).origin)
1313
except AttributeError as e:
14-
if os.getenv('BUILD_DOCS', '0') == '1':
15-
pass
16-
else:
14+
if os.getenv('BUILD_DOCS', '0') != '1':
1715
raise AttributeError(e)
1816

1917

torch_scatter/segment_coo.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99
torch.ops.load_library(importlib.machinery.PathFinder().find_spec(
1010
'_segment_coo', [osp.dirname(__file__)]).origin)
1111
except AttributeError as e:
12-
if os.getenv('BUILD_DOCS', '0') == '1':
13-
pass
14-
else:
12+
if os.getenv('BUILD_DOCS', '0') != '1':
1513
raise AttributeError(e)
1614

1715

torch_scatter/segment_csr.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99
torch.ops.load_library(importlib.machinery.PathFinder().find_spec(
1010
'_segment_csr', [osp.dirname(__file__)]).origin)
1111
except AttributeError as e:
12-
if os.getenv('BUILD_DOCS', '0') == '1':
13-
pass
14-
else:
12+
if os.getenv('BUILD_DOCS', '0') != '1':
1513
raise AttributeError(e)
1614

1715

0 commit comments

Comments
 (0)