SparseDiffTools.jl
SparseDiffTools.jl copied to clipboard
out of place tag not being recorded properly
The out of place JacVec is not taking properly the tag parameter for out of place operations
using SparseDiffTools
using ForwardDiff
using LinearAlgebra
N = 10
A = rand(N,N)
function foo(x)
println(typeof(x))
return A*x
end
function foo!(y,x)
println(typeof(x))
mul!(y,A,x)
return y
end
J = JacVec(foo, rand(N), tag = nothing)
J! = JacVec(foo!, rand(N), tag = nothing)
J*rand(N); #Vector{ForwardDiff.Dual{ForwardDiff.Tag{SparseDiffTools.DeivVecTag, Float64}, Float64, 1}}
y = similar(rand(N));
mul!(y, J, rand(N)); #Vector{ForwardDiff.Dual{Nothing, Float64, 1}}