Closed
Description
Running the following code
using ForwardDiff
using StaticArrays
f(x)=SA[x[1]^2+x[2]^2, x[2]^2+x[3]^2]
x=SA[1.0,2,3]
y=f(x)
imdr=DiffResults.JacobianResult(y,x)
@code_warntype ForwardDiff.jacobian!(imdr,f,x)
shows up as not type stable for me in Julia 1.8.5.
Maybe also related is this older topic on discourse https://discourse.julialang.org/t/am-i-using-diffresults-jl-correctly/35894
I think it is coming from
Replacing the anonymous function d -> value(T,d)
with Base.Fix1(value,T)
fixes it for me.
I can make a PR in case this is the desired solution.
Metadata
Metadata
Assignees
Labels
No labels