Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
torch-sparse
Commits
60a29466
Commit
60a29466
authored
Feb 14, 2020
by
rusty1s
Browse files
cleaner
parent
292c315a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
torch_sparse/__init__.py
torch_sparse/__init__.py
+6
-4
No files found.
torch_sparse/__init__.py
View file @
60a29466
...
...
@@ -21,14 +21,16 @@ except OSError as e:
f
'version
{
major
}
.
{
minor
}
.'
)
raise
OSError
(
e
)
cuda_version
=
torch
.
ops
.
torch_sparse
.
cuda_version
()
if
cuda_version
!=
-
1
and
torch
.
version
.
cuda
is
not
None
:
# pragma: no cover
if
cuda_version
<
10000
:
if
torch
.
version
.
cuda
is
not
None
:
# pragma: no cover
cuda_version
=
torch
.
ops
.
torch_sparse
.
cuda_version
()
if
cuda_version
==
-
1
:
major
=
minor
=
0
elif
cuda_version
<
10000
:
major
,
minor
=
int
(
str
(
cuda_version
)[
0
]),
int
(
str
(
cuda_version
)[
2
])
else
:
major
,
minor
=
int
(
str
(
cuda_version
)[
0
:
2
]),
int
(
str
(
cuda_version
)[
3
])
t_major
,
t_minor
=
[
int
(
x
)
for
x
in
torch
.
version
.
cuda
.
split
(
'.'
)]
cuda_version
=
str
(
major
)
+
'.'
+
str
(
minor
)
if
t_major
!=
major
or
t_minor
!=
minor
:
raise
RuntimeError
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment