-
-
Notifications
You must be signed in to change notification settings - Fork 617
Open
Labels
Description
julia> struct M end
julia> Flux.@layer M
julia> m = M()
M()
julia> fmap(identity, m)
M()
julia> f32(m)
ERROR: StackOverflowError:
Stacktrace:
[1] fmap(::Function, ::M; exclude::Function, walk::Functors.DefaultWalk, cache::IdDict{Any, Any}, prune::Functors.NoKeyword)
@ Functors ~/.julia/packages/Functors/LbNAu/src/maps.jl:7
[2] fmap(::Function, ::M)
@ Functors ~/.julia/packages/Functors/LbNAu/src/maps.jl:3
[3] adapt_structure(to::Flux.FluxEltypeAdaptor{Float32}, layer::M)
@ Main ~/.julia/packages/Flux/Mhg1r/src/layers/macro.jl:102
[4] adapt(to::Flux.FluxEltypeAdaptor{Float32}, x::M)
@ Adapt ~/.julia/packages/Adapt/VO8tI/src/Adapt.jl:40
[5] (::Base.Fix1{typeof(Adapt.adapt), Flux.FluxEltypeAdaptor{Float32}})(y::M)
@ Base ./operators.jl:1127
[6] (::Functors.ExcludeWalk{Functors.DefaultWalk, Base.Fix1{…}, typeof(Functors.isleaf)})(::Function, ::M)
@ Functors ~/.julia/packages/Functors/LbNAu/src/walks.jl:126
[7] (::Functors.CachedWalk{Functors.ExcludeWalk{…}, Functors.NoKeyword, Functors.WalkCache{…}})(::Function, ::M)
@ Functors ~/.julia/packages/Functors/LbNAu/src/walks.jl:177
[8] execute(::Functors.CachedWalk{Functors.ExcludeWalk{…}, Functors.NoKeyword, Functors.WalkCache{…}}, ::M)
@ Functors ~/.julia/packages/Functors/LbNAu/src/walks.jl:55
[9] fmap(::Function, ::M; exclude::Function, walk::Functors.DefaultWalk, cache::IdDict{Any, Any}, prune::Functors.NoKeyword)
@ Functors ~/.julia/packages/Functors/LbNAu/src/maps.jl:11
--- the above 8 lines are repeated 7870 more times ---
[62970] fmap(::Function, ::M)
@ Functors ~/.julia/packages/Functors/LbNAu/src/maps.jl:3
[62971] _paramtype(::Type{Float32}, m::M)
@ Flux ~/.julia/packages/Flux/Mhg1r/src/functor.jl:127
Some type information was truncated. Use `show(err)` to see complete types.