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
dgl
Commits
3eac464a
Unverified
Commit
3eac464a
authored
Dec 26, 2022
by
czkkkkkk
Committed by
GitHub
Dec 26, 2022
Browse files
[Sparse] Fix the sddmm backward problem in mock_sparse. (#5070)
parent
4aff59f7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
python/dgl/mock_sparse/sddmm.py
python/dgl/mock_sparse/sddmm.py
+3
-1
No files found.
python/dgl/mock_sparse/sddmm.py
View file @
3eac464a
...
@@ -54,7 +54,9 @@ def sddmm(
...
@@ -54,7 +54,9 @@ def sddmm(
"scalar values. "
"scalar values. "
)
)
# PyTorch's sddmm operator only supports CSR format.
# PyTorch's sddmm operator only supports CSR format.
res
=
torch
.
sparse
.
sampled_addmm
(
A
.
adj
.
to_sparse_csr
(),
mat1
,
mat2
)
res
=
torch
.
sparse
.
sampled_addmm
(
A
.
adj
.
to_sparse_csr
(),
mat1
,
mat2
).
to_sparse_coo
()
return
SparseMatrix
(
A
.
row
,
A
.
col
,
res
.
values
(),
A
.
adj
.
shape
)
return
SparseMatrix
(
A
.
row
,
A
.
col
,
res
.
values
(),
A
.
adj
.
shape
)
...
...
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