Skip to content

Commit 702103e

Browse files
committed
fix division by zero
1 parent ff28536 commit 702103e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

torch_scatter/composite/std.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ def scatter_std(src: torch.Tensor, index: torch.Tensor, dim: int = -1,
3434

3535
if unbiased:
3636
count = count.sub(1).clamp_(1)
37-
out = out.div(count).sqrt()
37+
out = out.div(count + 1e-6).sqrt()
3838

3939
return out

0 commit comments

Comments
 (0)