From bc7b54c04a1a7569b3ad5e87c219e6100a628578 Mon Sep 17 00:00:00 2001 From: Dowon Date: Sun, 28 Aug 2022 03:05:17 +0900 Subject: [PATCH] Mark `track_stats=true` as deprecated (#2042) * GroupNorm arguments warning * InstanceNorm arguments warning * force to warn a deprecation message --- src/layers/normalise.jl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/layers/normalise.jl b/src/layers/normalise.jl index 446575f355..0f2696a50a 100644 --- a/src/layers/normalise.jl +++ b/src/layers/normalise.jl @@ -431,6 +431,10 @@ function InstanceNorm(chs::Int, λ=identity; affine=false, track_stats=false, ϵ=1f-5, momentum=0.1f0) + if track_stats + Base.depwarn("`track_stats=true` will be removed from InstanceNorm in Flux 0.14. The default value is `track_stats=false`, which will work as before.", :InstanceNorm) + end + β = affine ? initβ(chs) : nothing γ = affine ? initγ(chs) : nothing μ = track_stats ? zeros32(chs) : nothing @@ -529,6 +533,10 @@ function GroupNorm(chs::Int, G::Int, λ=identity; affine=true, track_stats=false, ϵ=1f-5, momentum=0.1f0) +if track_stats + Base.depwarn("`track_stats=true` will be removed from GroupNorm in Flux 0.14. The default value is `track_stats=false`, which will work as before.", :GroupNorm) +end + chs % G == 0 || error("The number of groups ($(G)) must divide the number of channels ($chs)") β = affine ? initβ(chs) : nothing