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
18bd8b67
Unverified
Commit
18bd8b67
authored
Jul 23, 2020
by
Matthias Fey
Committed by
GitHub
Jul 23, 2020
Browse files
Fix reduce in dim=0
parent
0a60df35
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
torch_sparse/reduce.py
torch_sparse/reduce.py
+1
-1
No files found.
torch_sparse/reduce.py
View file @
18bd8b67
...
@@ -35,7 +35,7 @@ def reduction(src: SparseTensor, dim: Optional[int] = None,
...
@@ -35,7 +35,7 @@ def reduction(src: SparseTensor, dim: Optional[int] = None,
if
dim
==
0
and
value
is
not
None
:
if
dim
==
0
and
value
is
not
None
:
col
=
src
.
storage
.
col
()
col
=
src
.
storage
.
col
()
return
scatter
(
value
,
col
,
dim
=
0
,
dim_size
=
src
.
size
(
0
)
)
return
scatter
(
value
,
col
,
0
,
None
,
src
.
size
(
1
),
reduce
)
elif
dim
==
0
and
value
is
None
:
elif
dim
==
0
and
value
is
None
:
if
reduce
==
'sum'
or
reduce
==
'add'
:
if
reduce
==
'sum'
or
reduce
==
'add'
:
return
src
.
storage
.
colcount
().
to
(
src
.
dtype
())
return
src
.
storage
.
colcount
().
to
(
src
.
dtype
())
...
...
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