Closed
Description
We have talked about this before, just writing it down so it doesn't get lost.
The ChainRulesCore.RuleConfig
with the right traits, provides all the parts needed for either getting the pushforward (frule_via_ad
) or pullback (rrule_via_ad
); or both.
This primitives are enough to let AbstractDifferentiation.jl define everything else.
Any ChainRules supporting AD that supports rules that require calling back into AD must define one of these.
Zygote.ZygoteRuleConfig
and Diffractor.DiffractorRuleConfig
for example.
Given such a RuleConfig
type, it should be a one-liner to get the whole AbstractDifferentiation API.
We should provide a macro to make that so.