Skip to content

Commit 4903fcd

Browse files
committed
error handling
1 parent b9198f0 commit 4903fcd

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

torch_sparse/__init__.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,12 @@
1111
torch.ops.load_library(importlib.machinery.PathFinder().find_spec(
1212
library, [osp.dirname(__file__)]).origin)
1313
except OSError as e:
14-
if 'undefined symbol' in str(e):
15-
major, minor = [int(x) for x in torch.__version__.split('.')[:2]]
16-
t_major, t_minor = expected_torch_version
17-
if major != t_major or (major == t_major and minor != t_minor):
18-
raise RuntimeError(
19-
f'Expected PyTorch version {t_major}.{t_minor} but found '
20-
f'version {major}.{minor}.')
14+
major, minor = [int(x) for x in torch.__version__.split('.')[:2]]
15+
t_major, t_minor = expected_torch_version
16+
if major != t_major or (major == t_major and minor != t_minor):
17+
raise RuntimeError(
18+
f'Expected PyTorch version {t_major}.{t_minor} but found '
19+
f'version {major}.{minor}.')
2120
raise OSError(e)
2221

2322
if torch.version.cuda is not None: # pragma: no cover

0 commit comments

Comments
 (0)