Skip to content

Commit 0b79077

Browse files
committed
inverse if
1 parent f6aaacc commit 0b79077

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

torch_sparse/transpose.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ def transpose_matrix(index, value, m, n):
3535

3636
assert value.dim() == 1
3737

38-
if not index.is_cuda:
38+
if index.is_cuda:
39+
return transpose(index, value, m, n)
40+
else:
3941
mat = to_scipy(index, value, m, n).tocsc()
4042
(col, row), value = from_scipy(mat)
4143
index = torch.stack([row, col], dim=0)
4244
return index, value
43-
else:
44-
return transpose(index, value, m, n)

0 commit comments

Comments
 (0)