McCoy R. Becker

Results 184 comments of McCoy R. Becker

This is because https://github.com/dfdx/Ghost.jl/blob/13c283a1e92a533686eff97736142ea7f3741901/src/trace.jl#L290-L293 branches can have `Any` conditions: https://github.com/FluxML/IRTools.jl/blob/948773227955e29a6caae44d109e8be56db6e605/src/ir/ir.jl#L39-L43 I suspect a `false` or `true` propagates to the condition.

Absolutely. I don’t fully understand this code - but I can transform the MWEs into a small set of tests.

Well it’s catching things which do have gradients - so the intention is not working as expected. Is there an example of when the shortcut is applied? That would help...

Bump. @willtebbutt @DhairyaLGandhi Any pointers for fixing this PR now?

Here's another MWE. This one is a little more complex, because it matches a use case that I have. `Julia version = 1.5, Zygote version = 0.5.4` ```julia module GradsMVP...

To fix this MWE, it suffices to define the adjoint for `getindex`: ```julia Zygote.@adjoint getindex(d::Dict, acc) = getindex(d, acc), retgrad -> (retgrad, nothing) ``` I'm unsure if this will break...

@DhairyaLGandhi it's not Zygote's version of `getindex` - print outs of `grad` show the correct gradients. This makes sense - that's obviously something which has been tested numerous times. Something...

PS This is fixed on `0.4.20` as @willtebbutt says. I just checked with my own codebase.

@DhairyaLGandhi when I print out `accum` in the adjoint for `getindex` - I see the correct gradients. But in the MWE above, the returned grad is `nothing`.