Skip to content

Commit

Permalink
Merge pull request #310 from JuliaDiff/ChrisRackauckas-patch-2
Browse files Browse the repository at this point in the history
Fix AutoFiniteDiff caching
  • Loading branch information
ChrisRackauckas authored Dec 22, 2024
2 parents 601ff82 + f05b38b commit 5deb9d9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/differentiation/jaches_products.jl
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,9 @@ function JacVec(f, u::AbstractArray, p = nothing, t = nothing; fu = nothing,
cache, vecprod, vecprod! = if autodiff isa AutoFiniteDiff
cache1 = similar(fu)
cache2 = similar(u)
cache3 = similar(u)

(cache1, cache2), num_jacvec, num_jacvec!
(cache1, cache2, cache3), num_jacvec, num_jacvec!
elseif autodiff isa AutoForwardDiff
cache1 = Dual{
typeof(ForwardDiff.Tag(tag, eltype(u))), eltype(u), 1
Expand Down

0 comments on commit 5deb9d9

Please sign in to comment.