ForwardDiff.jl
ForwardDiff.jl copied to clipboard
jacobian with StaticArray always uses autogenerated Tag
It doesn't seem to be possible to explicitly set the Tag when using StaticArrays to calculate an out-of-place Jacobian. This is needed when f uses preallocated internal buffer arrays, which must match the Dual number type. For other array types, this can be set by supplying a cfg::JacobianConfig, however this argument is ignored when using StaticArrays.
Looks like the problem is in jacobian.jl L85-87 which then calls L183-186 so any cfg argument to jacobian is ignored, and the Tag is always autogenerated.
Related: Discussion in issue 296, https://github.com/JuliaDiff/ForwardDiff.jl/issues/296#issuecomment-365045955 PR https://github.com/JuliaDiff/ForwardDiff.jl/pull/304