Unverified Commit 18bd8b67 authored by Matthias Fey's avatar Matthias Fey Committed by GitHub
Browse files

Fix reduce in dim=0

parent 0a60df35
...@@ -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())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment