"git@developer.sourcefind.cn:OpenDAS/torchaudio.git" did not exist on "4875007def12f8365724c22e948f87766f6011c4"
Commit 702103ed authored by rusty1s's avatar rusty1s
Browse files

fix division by zero

parent ff285368
...@@ -34,6 +34,6 @@ def scatter_std(src: torch.Tensor, index: torch.Tensor, dim: int = -1, ...@@ -34,6 +34,6 @@ def scatter_std(src: torch.Tensor, index: torch.Tensor, dim: int = -1,
if unbiased: if unbiased:
count = count.sub(1).clamp_(1) count = count.sub(1).clamp_(1)
out = out.div(count).sqrt() out = out.div(count + 1e-6).sqrt()
return out return out
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