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
4f8a6cc9
Commit
4f8a6cc9
authored
Dec 30, 2020
by
rusty1s
Browse files
cleanup
parent
9a4ea01b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
torch_sparse/spmm.py
torch_sparse/spmm.py
+2
-2
No files found.
torch_sparse/spmm.py
View file @
4f8a6cc9
...
...
@@ -15,12 +15,12 @@ def spmm(index, value, m, n, matrix):
:rtype: :class:`Tensor`
"""
assert
n
==
matrix
.
s
hape
[
-
2
]
assert
n
==
matrix
.
s
ize
(
-
2
)
row
,
col
=
index
matrix
=
matrix
if
matrix
.
dim
()
>
1
else
matrix
.
unsqueeze
(
-
1
)
out
=
matrix
[...
,
col
,
:]
out
=
matrix
.
index_select
(
-
2
,
col
)
out
=
out
*
value
.
unsqueeze
(
-
1
)
out
=
scatter_add
(
out
,
row
,
dim
=-
2
,
dim_size
=
m
)
...
...
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