-
-
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
display fieldnames in show of a container #2543
Comments
The present recursion roughly assumes the existence of the default constructor. This instead assumes the existence of a keyword constructor, which is much less common: julia> RNN(
cell = RNNCell(4 => 6, tanh), # 66 parameters
)
ERROR: MethodError: no method matching RNN(; cell::RNNCell{typeof(tanh), Matrix{Float32}, Matrix{Float32}, Vector{Float32}})
The type `RNN` exists, but no method is defined for this combination of argument types when trying to construct it.
Closest candidates are:
...
RNN(::M) where M got unsupported keyword argument "cell"
@ Flux ~/.julia/packages/Flux/5vIRy/src/layers/recurrent.jl:171 You could put field names in the comment without breaking anything, It does show names for some where a keyword constructor is known to exist. That mechanism could surely be made more generalisable it someone wants it enough: julia> Chain(one=RNN(4 => 6, tanh), two=identity)
Chain(
one = RNN(
RNNCell(4 => 6, tanh), # 66 parameters
),
two = identity,
) # Total: 3 arrays, 66 parameters, 424 bytes. |
This is because you want the output to be a valid constructor when copy-pasted, right? |
We can have an option for |
I think it would be helpfuld to display the fieldnames in our bigshow.
For example, we currently have
that could become
The text was updated successfully, but these errors were encountered: