Skip to content
This repository was archived by the owner on Aug 22, 2025. It is now read-only.

Commit 51cce64

Browse files
committed
add kwarg argument to accept forwarddiff tag in JacVec, HesVec, HesVecGrad
1 parent 655cdd1 commit 51cce64

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/differentiation/jaches_products.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,8 @@ function JacVec(f, u::AbstractArray, p = nothing, t = nothing;
262262
kwargs...)
263263
end
264264

265-
function HesVec(f, u::AbstractArray, p = nothing, t = nothing; autodiff = AutoForwardDiff(),
266-
kwargs...)
265+
function HesVec(f, u::AbstractArray, p = nothing, t = nothing;
266+
autodiff = AutoForwardDiff(), tag = DeivVecTag(), kwargs...)
267267
cache, vecprod, vecprod! = if autodiff isa AutoFiniteDiff
268268
cache1 = similar(u)
269269
cache2 = similar(u)
@@ -280,7 +280,7 @@ function HesVec(f, u::AbstractArray, p = nothing, t = nothing; autodiff = AutoFo
280280
@assert static_hasmethod(autoback_hesvec, typeof((f, u, u))) "To use AutoZygote() AD, first load Zygote with `using Zygote`, or `import Zygote`"
281281

282282
cache1 = Dual{
283-
typeof(ForwardDiff.Tag(DeivVecTag(), eltype(u))), eltype(u), 1
283+
typeof(ForwardDiff.Tag(tag, eltype(u))), eltype(u), 1
284284
}.(u, ForwardDiff.Partials.(tuple.(u)))
285285
cache2 = copy(cache1)
286286

0 commit comments

Comments
 (0)