Skip to content
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

Flux.@functor is broken on 0.15 #2545

Closed
mcabbott opened this issue Dec 8, 2024 · 1 comment · Fixed by #2546
Closed

Flux.@functor is broken on 0.15 #2545

mcabbott opened this issue Dec 8, 2024 · 1 comment · Fixed by #2546
Labels

Comments

@mcabbott
Copy link
Member

mcabbott commented Dec 8, 2024

julia> using Flux

julia> struct Layer; stuff; end;

julia> Flux.@functor Layer
┌ Warning: The use of `Flux.@functor` is deprecated.
│ Most likely, you should write `Flux.@layer MyLayer` which will add various convenience methods for your type,
│ such as pretty-printing and use with Adapt.jl.
│ However, this is not required. Flux.jl v0.15 uses Functors.jl v0.5, which makes exploration of most nested `struct`s
│ opt-out instead of opt-in... so Flux will automatically see inside any custom struct definitions.
│ If you really want to apply the `@functor` macro to a custom struct, use `Functors.@functor` instead.
└ @ Flux ~/.julia/packages/Flux/5vIRy/src/deprecations.jl:101
ERROR: UndefVarError: `makefunctor` not defined
Stacktrace:
 [1] top-level scope
   @ REPL[14]:1
@CarloLucibello
Copy link
Member

Responsible line

return Functors.functorm(args...)

I don't know how to fix this, as I don't know how to have a macro fall back to another macro

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants