Closed gdalle closed 4 months ago
This PR adds an AutoChainRules AD type. It is built from a RuleConfig to allow calling back into AD with frule_via_ad or rrule_via_ad (see https://juliadiff.org/ChainRulesCore.jl/stable/rule_author/superpowers/ruleconfig.html). It does not inherit from AbstractForwardMode or AbstractReverseMode because it can be both.
AutoChainRules
RuleConfig
frule_via_ad
rrule_via_ad
AbstractForwardMode
AbstractReverseMode
A similar pattern was used in AbstractDifferentiation.jl
https://github.com/JuliaDiff/AbstractDifferentiation.jl/blob/2bc18d07eb5038c997a7f9253bc3f1457124710e/src/backends.jl#L64-L66
Checklist
Additional context
This PR adds an
AutoChainRules
AD type. It is built from aRuleConfig
to allow calling back into AD withfrule_via_ad
orrrule_via_ad
(see https://juliadiff.org/ChainRulesCore.jl/stable/rule_author/superpowers/ruleconfig.html). It does not inherit fromAbstractForwardMode
orAbstractReverseMode
because it can be both.A similar pattern was used in AbstractDifferentiation.jl
https://github.com/JuliaDiff/AbstractDifferentiation.jl/blob/2bc18d07eb5038c997a7f9253bc3f1457124710e/src/backends.jl#L64-L66