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
0b790779
Commit
0b790779
authored
Mar 21, 2019
by
rusty1s
Browse files
inverse if
parent
f6aaacc1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
torch_sparse/transpose.py
torch_sparse/transpose.py
+3
-3
No files found.
torch_sparse/transpose.py
View file @
0b790779
...
@@ -35,10 +35,10 @@ def transpose_matrix(index, value, m, n):
...
@@ -35,10 +35,10 @@ def transpose_matrix(index, value, m, n):
assert
value
.
dim
()
==
1
assert
value
.
dim
()
==
1
if
not
index
.
is_cuda
:
if
index
.
is_cuda
:
return
transpose
(
index
,
value
,
m
,
n
)
else
:
mat
=
to_scipy
(
index
,
value
,
m
,
n
).
tocsc
()
mat
=
to_scipy
(
index
,
value
,
m
,
n
).
tocsc
()
(
col
,
row
),
value
=
from_scipy
(
mat
)
(
col
,
row
),
value
=
from_scipy
(
mat
)
index
=
torch
.
stack
([
row
,
col
],
dim
=
0
)
index
=
torch
.
stack
([
row
,
col
],
dim
=
0
)
return
index
,
value
return
index
,
value
else
:
return
transpose
(
index
,
value
,
m
,
n
)
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