@@ -40,17 +40,28 @@ function __pick_forwarddiff_chunk(x::StaticArray)
4040 end
4141end
4242
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}
4444 ck = (CS === nothing || CS ≤ 0 ) ? __pick_forwarddiff_chunk (x) : ForwardDiff. Chunk {CS} ()
4545 tag = __standard_tag (ad. tag, x)
46- return ForwardDiff . JacobianConfig (f, x, ck, tag)
46+ return __forwarddiff_jacobian_config (f, x, ck, tag)
4747end
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}
4949 ck = (CS === nothing || CS ≤ 0 ) ? __pick_forwarddiff_chunk (x) : ForwardDiff. Chunk {CS} ()
5050 tag = __standard_tag (ad. tag, x)
5151 return ForwardDiff. JacobianConfig (f!, y, x, ck, tag)
5252end
5353
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+
5465function __get_jacobian_config (ad:: AutoPolyesterForwardDiff{CS} , args... ) where {CS}
5566 x = last (args)
5667 return (CS === nothing || CS ≤ 0 ) ? __pick_forwarddiff_chunk (x) :
0 commit comments