Skip to content

Commit

Permalink
Mark track_stats=true as deprecated (#2042)
Browse files Browse the repository at this point in the history
* GroupNorm arguments warning

* InstanceNorm arguments warning

* force to warn a deprecation message
  • Loading branch information
akahard2dj authored Aug 27, 2022
1 parent f5882c7 commit bc7b54c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/layers/normalise.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit bc7b54c

Please sign in to comment.