1
1
# This file is a part of ForwardDiffPullbacks.jl, licensed under the MIT License (MIT).
2
2
3
+
4
+ # ToDo: Use ProjectTo in rrules (requires ChainRulesCore >= v0.10.11).
5
+
6
+
3
7
struct FwdDiffPullbackThunk{F<: Base.Callable ,T<: Tuple ,i,U<: Any } <: ChainRulesCore.AbstractThunk
4
8
f:: F
5
9
xs:: T
@@ -11,9 +15,10 @@ function FwdDiffPullbackThunk(f::F, xs::T, ::Val{i}, ΔΩ::U) where {F<:Base.Cal
11
15
end
12
16
13
17
@inline function ChainRulesCore. unthunk (tnk:: FwdDiffPullbackThunk{F,T,i,U} ) where {F,T,i,U}
14
- forwarddiff_fwd_back (tnk. f, tnk. xs, Val (i), tnk. ΔΩ)
18
+ forwarddiff_fwd_back (tnk. f, tnk. xs, Val (i), unthunk ( tnk. ΔΩ) )
15
19
end
16
20
21
+ # ToDo: Remove (obsolete with ChainRulesCore >= v0.10.):
17
22
(tnk:: FwdDiffPullbackThunk )() = ChainRulesCore. unthunk (tnk)
18
23
19
24
@@ -48,9 +53,10 @@ function FwdDiffBCPullbackThunk(f::F, Xs::T, ::Val{i}, ΔΩA::U) where {F<:Base.
48
53
end
49
54
50
55
@inline function ChainRulesCore. unthunk (tnk:: FwdDiffBCPullbackThunk{F,T,i,U} ) where {F,T,i,U}
51
- forwarddiff_bc_fwd_back (tnk. f, tnk. Xs, Val (i), tnk. ΔΩA)
56
+ forwarddiff_bc_fwd_back (tnk. f, tnk. Xs, Val (i), unthunk ( tnk. ΔΩA) )
52
57
end
53
58
59
+ # ToDo: Remove (obsolete with ChainRulesCore >= v0.10.):
54
60
(tnk:: FwdDiffBCPullbackThunk )() = ChainRulesCore. unthunk (tnk)
55
61
56
62
0 commit comments