Skip to content

Commit 2ce9c42

Browse files
committed
set init=0 in stats update
1 parent 5b49a64 commit 2ce9c42

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/normalization.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ function update_running_stats!(stats::RunningStats, x, μ, σ², reduce_dims::Di
138138
V = eltype(σ²)
139139
momentum = stats.momentum
140140
res_mtm = one(V) - momentum
141-
m = prod(size(x, i) for i in reduce_dims)
141+
m = prod(size(x, i) for i in reduce_dims; init = 1)
142142
correction = m / (m - one(V))
143143

144144
running_mean, running_var = stats.mean, stats.variance

0 commit comments

Comments
 (0)