Skip to content

Commit bc7b54c

Browse files
authored
Mark track_stats=true as deprecated (#2042)
* GroupNorm arguments warning * InstanceNorm arguments warning * force to warn a deprecation message
1 parent f5882c7 commit bc7b54c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/layers/normalise.jl

+8
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,10 @@ function InstanceNorm(chs::Int, λ=identity;
431431
affine=false, track_stats=false,
432432
ϵ=1f-5, momentum=0.1f0)
433433

434+
if track_stats
435+
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)
436+
end
437+
434438
β = affine ? initβ(chs) : nothing
435439
γ = affine ? initγ(chs) : nothing
436440
μ = track_stats ? zeros32(chs) : nothing
@@ -529,6 +533,10 @@ function GroupNorm(chs::Int, G::Int, λ=identity;
529533
affine=true, track_stats=false,
530534
ϵ=1f-5, momentum=0.1f0)
531535

536+
if track_stats
537+
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)
538+
end
539+
532540
chs % G == 0 || error("The number of groups ($(G)) must divide the number of channels ($chs)")
533541

534542
β = affine ? initβ(chs) : nothing

0 commit comments

Comments
 (0)