Skip to content

Commit af0c496

Browse files
authored
Fix return order in autodiff_thunk docs (#2274)
1 parent a74ec0d commit af0c496

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Enzyme.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,8 +1028,8 @@ ftype when called with args of type `argtypes`.
10281028
`Activity` is the Activity of the return value, it may be `Const` or `Duplicated`
10291029
(or its variants `DuplicatedNoNeed`, `BatchDuplicated`, and`BatchDuplicatedNoNeed`).
10301030
1031-
The forward function will return the primal (if requested) and the shadow
1032-
(or nothing if not a `Duplicated` variant).
1031+
The forward function will return the shadow (or nothing if not a `Duplicated` variant)
1032+
and the primal (if requested).
10331033
10341034
Example returning both the return derivative and original return:
10351035
@@ -1040,7 +1040,7 @@ c = 55; d = 9
10401040
10411041
f(x) = x*x
10421042
forward = autodiff_thunk(ForwardWithPrimal, Const{typeof(f)}, Duplicated, Duplicated{Float64})
1043-
res, ∂f_∂x = forward(Const(f), Duplicated(3.14, 1.0))
1043+
∂f_∂x, res = forward(Const(f), Duplicated(3.14, 1.0))
10441044
10451045
# output
10461046
@@ -1056,7 +1056,7 @@ c = 55; d = 9
10561056
10571057
f(x) = x*x
10581058
forward = autodiff_thunk(Forward, Const{typeof(f)}, Duplicated, Duplicated{Float64})
1059-
∂f_∂x = forward(Const(f), Duplicated(3.14, 1.0))
1059+
∂f_∂x, = forward(Const(f), Duplicated(3.14, 1.0))
10601060
10611061
# output
10621062

0 commit comments

Comments
 (0)