-
-
Notifications
You must be signed in to change notification settings - Fork 609
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adjust docs & Flux.@functor
for Functors.jl v0.5, plus misc. depwarns
#2509
base: master
Are you sure you want to change the base?
Conversation
Functors v0.5 is out |
We can continue with this now that Functors v0.5 is in with #2525 |
I subsumed most of this into #2528 in order to speed up the 0.15 release. |
I think we should not implement a |
It's not so much to add functionality, as to avoid this:
IMO that's an extremely unfriendly upgrade path. It would be OK to just print an error message, but doing what you ask as well is pretty easy. |
Ah no, that shouldn't happen, we should have |
Yea, but better to prod people to update. Hence this PR. |
161dcda
to
467ea36
Compare
and the explicit `gradient(m -> loss(m, x, y), model)` for gradient computation. | ||
""", :params) | ||
@warn """`Flux.params(m...)` is deprecated. Use `Flux.trainable(model)` for parameter collection, | ||
and the explicit `gradient(m -> loss(m, x, y), model)` for gradient computation.""" maxlog=1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Base.depwarn
is silent except in tests. IMO that's ideal if you are marking something deprecated before a breaking change, when the replacement is available.
However, my impression is that we really want people to change this, not to silently live with old code during 0.15. So I'd like something to be printed in interactive use.
Maybe the same goes for more of the depwarns in this file?
# Enable these when 0.16 is released, and delete const ClipGrad = Optimise.ClipValue etc: | ||
# Base.@deprecate_binding Optimiser OptimiserChain | ||
# Base.@deprecate_binding ClipValue ClipGrad |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These const definitions have already been deleted:
julia> Flux.ClipValue
ERROR: UndefVarError: `ClipValue` not defined
Stacktrace:
[1] getproperty(x::Module, f::Symbol)
@ Base ./Base.jl:31
[2] top-level scope
@ REPL[6]:1
julia> Flux.Optimiser
ERROR: UndefVarError: `Optimiser` not defined
Stacktrace:
[1] getproperty(x::Module, f::Symbol)
@ Base ./Base.jl:31
[2] top-level scope
@ REPL[7]:1
@layer
for Functors.jl v0.5Flux.@functor
for Functors.jl v0.5, plus misc. depwarns
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2509 +/- ##
===========================================
+ Coverage 33.54% 61.38% +27.84%
===========================================
Files 31 31
Lines 1881 1919 +38
===========================================
+ Hits 631 1178 +547
+ Misses 1250 741 -509 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
After FluxML/Functors.jl#51 we should stop saying that you need either
@layer
or@functor
for Flux to find your parameters.This PR:
Flux.@functor
which prints a depwarn & then calls@layer
removes the code from@layer
which printed other depwarnsremoves the code from@layer
which definesfunctor
Fixes #2533
WIP, more doc changes needed.
PR Checklist