You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 22, 2025. It is now read-only.
There doesn't seem to be an argument for chunk_size in JacVec or JacVecOperator. My code has some temporary variables inside so I use dualcache. But my choice of chunk_size in dualcache is not compatible with JacVec unless it is set to 1.
Here's an example using the example shown in the dualcache tutorial:
using LinearAlgebra, OrdinaryDiffEq, PreallocationTools
functionfoo(du, u, (A, tmp), t)
tmp =get_tmp(tmp, u)
mul!(tmp, A, u)
@. du = u + tmp
nothingend
chunk_size =1# chunk_size = 5 doesn't work!
(A, tmp) = (ones(5,5), dualcache(zeros(5), Val{chunk_size}))
ff = (y,x)->foo(y,x,(A,tmp),nothing)
u0 =rand(5);
du0 =similar(u0);
ff(du0,u0)
using SparseDiffTools
J =JacVec(ff,u0;autodiff=true);
res =similar(u0);
mul!(res,J,u0) # Does 1 f evaluation