Skip to content

Commit 977d271

Browse files
mzgubicoxinabox
andauthored
Update docs/src/index.md
Co-authored-by: Lyndon White <oxinabox@ucc.asn.au>
1 parent aac3e27 commit 977d271

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

docs/src/index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,8 @@ end
183183

184184
that we do not know an `rrule` for, and we want to check whether the gradients provided by the AD system are correct.
185185

186-
To test gradients the AD system will need to overload `rrule_via_ad` function which wraps the gradients computed by AD.
186+
To test gradients the AD system you need to provide a `rrule_f` function that acts like calling `rrule` but use AD rather than a defined rule.
187+
This has the exact same semantics as is required to overload `ChainRulesCore.rrule_via_ad`, thus almost all systems doing so should just overload that, and pass in that and the config, and then trigger `test_rrule(MyADConfig, f, xs; rrule_f = ChainRulesCore.rrule_via_ad)`.
187188
For some AD systems (e.g. Zygote) this already exists.
188189
If it does not exist, see [How to write `rrule_via_ad` function](#How-to-write-rrule_via_ad-function) section below.
189190

0 commit comments

Comments
 (0)