We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Dict
If we insert a Dict into a struct field and do some calculations with that Dict, we get a nothing derivative with respect to that field.
nothing
Example is on 0.6.29. I included a second field to show that gradients still accumulate for the other fields.
0.6.29
struct Container x y end f_dict(d,y) = d[:a]^2 + y^3 f_container(c) = c.x[:a]^2 + c.y^3 d = Dict(:a => 3) c = Container(d, 4.0) Zygote.gradient(f_dict, d, 4.0) # (Dict{Any, Any}(:a => 6.0), 48.0) Zygote.gradient(f_container, c) # ((x = nothing, y = 48.0),)
The text was updated successfully, but these errors were encountered:
Duplicate of #717
Sorry, something went wrong.
@SBuercklin we have many Dict-related issues dictionary I suggest to use NamedTuple instead of dictionary whenever possible
No branches or pull requests
If we insert a
Dict
into a struct field and do some calculations with thatDict
, we get anothing
derivative with respect to that field.Example is on
0.6.29
. I included a second field to show that gradients still accumulate for the other fields.The text was updated successfully, but these errors were encountered: