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
2fc280ba
Unverified
Commit
2fc280ba
authored
Aug 15, 2020
by
Zihao Ye
Committed by
GitHub
Aug 15, 2020
Browse files
only filling zeros for min/max reducer (#2026)
parent
62e69b67
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
python/dgl/ops/spmm.py
python/dgl/ops/spmm.py
+3
-1
No files found.
python/dgl/ops/spmm.py
View file @
2fc280ba
...
...
@@ -62,7 +62,9 @@ def gspmm(g, op, reduce_op, lhs_data, rhs_data):
ret
=
gspmm_internal
(
g
.
_graph
,
op
,
'sum'
if
reduce_op
==
'mean'
else
reduce_op
,
lhs_data
,
rhs_data
)
ret
=
F
.
replace_inf_with_zero
(
ret
)
# Replace infinity with zero for isolated nodes when reducer is min/max
if
reduce_op
in
[
'min'
,
'max'
]:
ret
=
F
.
replace_inf_with_zero
(
ret
)
# divide in degrees for mean reducer.
if
reduce_op
==
'mean'
:
...
...
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