Skip to content

Commit 6bdf1e8

Browse files
committed
Improve docs
1 parent ae64a38 commit 6bdf1e8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/src/index.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ ForwardDiffPullbacks implements pullbacks compatible with [ChainRulesCore](https
44

55
This package provides the function [`fwddiff`](@ref). If wrapped around a function (i.e. `fwddiff(f)`), it will cause ChainRules (and implicitly Zygote) pullbacks to be calculated using ForwardDiff (i.e. by evaluating the original function with `ForwardDiff.Dual` numbers, possibly multiple times). The pullback will return a ChainRule thunk for each argument of the function.
66

7-
So `Zygote.gradient(fwddiff(f), xs...)` should yield the same result as `Zygote.gradient(f, xs...)`, but will typically be substantially faster a function that has a comparatively small number of arguments, especially if the function runs a deep calculation. Broadcasting (i.e. `g.(fwddiff(f))`) is supported as well.
7+
So `Zygote.gradient(fwddiff(f), xs...)` should yield the same result as `Zygote.gradient(f, xs...)`, but will typically be substantially faster for a function that has a comparatively small number of arguments, especially if the function runs a deep calculation.
8+
9+
ForwardDiffPullbacks does come with broadcasting support, `fwddiff(f).(args...)` will use ForwardDiff to differentiate each iteration in the broadcast separately.
810

911
Currently, ForwardDiffPullbacks supports functions whose arguments and result(s) are statically sized, like `Real`, `Tuple`, `StaticArrays.StaticArray` and (nested) `NamedTuple`s and plain structs. Dynamic arrays are not supported yet.

0 commit comments

Comments
 (0)