Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix return order in autodiff_thunk docs #2274

Merged
merged 1 commit into from
Jan 23, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/Enzyme.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1028,8 +1028,8 @@ ftype when called with args of type `argtypes`.
`Activity` is the Activity of the return value, it may be `Const` or `Duplicated`
(or its variants `DuplicatedNoNeed`, `BatchDuplicated`, and`BatchDuplicatedNoNeed`).
The forward function will return the primal (if requested) and the shadow
(or nothing if not a `Duplicated` variant).
The forward function will return the shadow (or nothing if not a `Duplicated` variant)
and the primal (if requested).
Example returning both the return derivative and original return:
Expand All @@ -1040,7 +1040,7 @@ c = 55; d = 9
f(x) = x*x
forward = autodiff_thunk(ForwardWithPrimal, Const{typeof(f)}, Duplicated, Duplicated{Float64})
res, ∂f_∂x = forward(Const(f), Duplicated(3.14, 1.0))
∂f_∂x, res = forward(Const(f), Duplicated(3.14, 1.0))
# output
Expand All @@ -1056,7 +1056,7 @@ c = 55; d = 9
f(x) = x*x
forward = autodiff_thunk(Forward, Const{typeof(f)}, Duplicated, Duplicated{Float64})
∂f_∂x = forward(Const(f), Duplicated(3.14, 1.0))
∂f_∂x, = forward(Const(f), Duplicated(3.14, 1.0))
# output
Expand Down
Loading