Skip to content

out of place tag not being recorded properly #314

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Veenty opened this issue Apr 22, 2025 · 0 comments
Open

out of place tag not being recorded properly #314

Veenty opened this issue Apr 22, 2025 · 0 comments

Comments

@Veenty
Copy link

Veenty commented Apr 22, 2025

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}}


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant