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
5586d7ae
Commit
5586d7ae
authored
Mar 17, 2019
by
rusty1s
Browse files
dtype spspmm fix for Windows
parent
2c883ba3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
torch_sparse/spspmm.py
torch_sparse/spspmm.py
+4
-2
No files found.
torch_sparse/spspmm.py
View file @
5586d7ae
import
torch
from
torch
import
from_numpy
import
numpy
as
np
import
scipy.sparse
from
torch_sparse
import
transpose
...
...
@@ -77,8 +78,9 @@ def to_scipy(index, value, m, n):
def
from_scipy
(
A
):
row
,
col
,
value
=
from_numpy
(
A
.
row
),
from_numpy
(
A
.
col
),
from_numpy
(
A
.
data
)
index
=
torch
.
stack
([
row
,
col
],
dim
=
0
).
to
(
torch
.
long
)
row
,
col
,
value
=
A
.
row
.
astype
(
np
.
int64
),
A
.
col
.
astype
(
np
.
int64
),
A
.
data
row
,
col
,
value
=
from_numpy
(
row
),
from_numpy
(
col
),
from_numpy
(
value
)
index
=
torch
.
stack
([
row
,
col
],
dim
=
0
)
return
index
,
value
...
...
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