Closed ziyiyin97 closed 5 months ago
Flux.jl uses Zygote.jl, and Zygote.jl doesn't yet utilise ChainRulesCore.jl's Thunk
s
https://github.com/FluxML/Zygote.jl/blob/9602c6b2038879034c2de14d1f4aa251d99c6ea4/src/compiler/chainrules.jl#L104
There is a WIP PR to make Zygote.jl utilise Thunk
s here: https://github.com/FluxML/Zygote.jl/pull/966
Thanks for your quick reply. Looking forward to the PR being merged
This is a Zygote problem not a CRC problem
Hello! I have a minimum example here about Flux and ChainRulesCore
which defines my custom function
f
(as a multiplication of 2 scalars) and defines therrule
from ChainRulesCore. In the last line, when I compute gradient w.r.t. variablea
only, asga = gradient(()->f(a,b), Flux.params(a))
, I expect to only see∇a
being called but actually I see both of∇a
and∇b
being called in the logany idea why? This could be problematic when
f
is complicated function and it is unnecessary to call∇b
if time-consuming. Thanks for any help!