@@ -40,17 +40,28 @@ function __pick_forwarddiff_chunk(x::StaticArray)
40
40
end
41
41
end
42
42
43
- function __get_jacobian_config (ad:: AutoForwardDiff{CS} , f, x) where {CS}
43
+ function __get_jacobian_config (ad:: AutoForwardDiff{CS} , f:: F , x) where {F, CS}
44
44
ck = (CS === nothing || CS ≤ 0 ) ? __pick_forwarddiff_chunk (x) : ForwardDiff. Chunk {CS} ()
45
45
tag = __standard_tag (ad. tag, x)
46
- return ForwardDiff . JacobianConfig (f, x, ck, tag)
46
+ return __forwarddiff_jacobian_config (f, x, ck, tag)
47
47
end
48
- function __get_jacobian_config (ad:: AutoForwardDiff{CS} , f!, y, x) where {CS}
48
+ function __get_jacobian_config (ad:: AutoForwardDiff{CS} , f!:: F , y, x) where {F, CS}
49
49
ck = (CS === nothing || CS ≤ 0 ) ? __pick_forwarddiff_chunk (x) : ForwardDiff. Chunk {CS} ()
50
50
tag = __standard_tag (ad. tag, x)
51
51
return ForwardDiff. JacobianConfig (f!, y, x, ck, tag)
52
52
end
53
53
54
+ function __forwarddiff_jacobian_config (f:: F , x, ck:: ForwardDiff.Chunk , tag) where {F}
55
+ return ForwardDiff. JacobianConfig (f, x, ck, tag)
56
+ end
57
+ function __forwarddiff_jacobian_config (
58
+ f:: F , x:: SArray , ck:: ForwardDiff.Chunk{N} , tag) where {F, N}
59
+ seeds = ForwardDiff. construct_seeds (ForwardDiff. Partials{N, eltype (x)})
60
+ duals = ForwardDiff. Dual {typeof(tag), eltype(x), N} .(x)
61
+ return ForwardDiff. JacobianConfig {typeof(tag), eltype(x), N, typeof(duals)} (seeds,
62
+ duals)
63
+ end
64
+
54
65
function __get_jacobian_config (ad:: AutoPolyesterForwardDiff{CS} , args... ) where {CS}
55
66
x = last (args)
56
67
return (CS === nothing || CS ≤ 0 ) ? __pick_forwarddiff_chunk (x) :
0 commit comments