You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
::typeof(pushforward), f!, y, backend::FromPrimitive, x, tx::NTuple
25
+
)
26
+
returnoverloaded_input(pushforward, f!, y, backend.backend, x, tx)
27
+
end
28
+
14
29
"""
15
-
AutoForwardFromPrimitive
30
+
AutoForwardFromPrimitive(backend::AbstractADType)
16
31
17
-
Wrapper which forces a given backend to act as a reverse-mode backend.
32
+
Wrapper which forces a given backend to act as a forward-mode backend, using only its native `value_and_pushforward` primitive and re-implementing the rest from scratch.
18
33
19
-
Used in internal testing.
34
+
!!! tip
35
+
This can be useful to circumvent high-level operators when they have impractical limitations.
36
+
For instance, ForwardDiff.jl's `jacobian` does not support GPU arrays but its `pushforward` does, so `AutoForwardFromPrimitive(AutoForwardDiff())` has a GPU-friendly `jacobian`.
@@ -133,17 +152,17 @@ function value_and_pushforward!(
133
152
end
134
153
135
154
"""
136
-
AutoReverseFromPrimitive
137
-
138
-
Wrapper which forces a given backend to act as a reverse-mode backend.
155
+
AutoReverseFromPrimitive(backend::AbstractADType)
139
156
140
-
Used in internal testing.
157
+
Wrapper which forces a given backend to act as a reverse-mode backend, using only its native `value_and_pullback` implementation and rebuilding the rest from scratch.
0 commit comments