Skip to content

Commit 467ea36

Browse files
committed
fix #2533
1 parent bf5af30 commit 467ea36

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

src/deprecations.jl

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,20 @@ function params!(p::Zygote.Params, x, seen = IdSet())
8383
end
8484
end
8585

86+
"""
87+
params(model)
88+
89+
Returns a `Zygote.Params` object containing all parameter arrays from the model.
90+
This is deprecated!
91+
92+
This function was the cornerstone of how Flux used Zygote's implicit mode gradients,
93+
but since Flux 0.13 we use explicit mode `gradient(m -> loss(m, x, y), model)` instead.
94+
95+
To collect all the parameter arrays for other purposes, use `Flux.trainables(model)`.
96+
"""
8697
function params(m...)
87-
Base.depwarn("""
88-
Flux.params(m...) is deprecated. Use `Flux.trainable(model)` for parameters' collection
89-
and the explicit `gradient(m -> loss(m, x, y), model)` for gradient computation.
90-
""", :params)
98+
@warn """`Flux.params(m...)` is deprecated. Use `Flux.trainable(model)` for parameter collection,
99+
and the explicit `gradient(m -> loss(m, x, y), model)` for gradient computation.""" maxlog=1
91100
ps = Params()
92101
params!(ps, m)
93102
return ps

0 commit comments

Comments
 (0)