Skip to content

Commit e4f8678

Browse files
authored
use var (#1973)
1 parent 28ee7b4 commit e4f8678

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "Flux"
22
uuid = "587475ba-b771-5e3f-ad9e-33799f191a9c"
3-
version = "0.13.2"
3+
version = "0.13.3"
44

55
[deps]
66
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"

src/layers/normalise.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ function _norm_layer_forward(
195195
σ² = reshape(l.σ², stats_shape)
196196
else # trainmode or testmode without tracked stats
197197
μ = mean(x; dims=reduce_dims)
198-
σ² = mean((x .- μ).^2; dims=reduce_dims)
198+
σ² = var(x; mean=μ, dims=reduce_dims, corrected=false)
199199
if l.track_stats
200200
_track_stats!(l, x, μ, σ², reduce_dims) # update moving mean/std
201201
end

0 commit comments

Comments
 (0)