Skip to content

Commit 8c9b6ea

Browse files
committed
set init=0 in stats update
1 parent 6882593 commit 8c9b6ea

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
@@ -123,7 +123,7 @@ function update_running_stats!(stats::RunningStats, x, μ, σ², reduce_dims::Di
123123
V = eltype(σ²)
124124
momentum = stats.momentum
125125
res_mtm = one(V) - momentum
126-
m = prod(size(x, i) for i in reduce_dims)
126+
m = prod(size(x, i) for i in reduce_dims; init = 1)
127127
correction = m / (m - one(V))
128128

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

0 commit comments

Comments
 (0)