Skip to content

Commit

Permalink
possibly fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
oscardssmith committed Nov 8, 2023
1 parent b720c86 commit 8568216
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/derivative_wrappers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,14 @@ function derivative!(df::AbstractArray{<:Number}, f,
alg = unwrap_alg(integrator, true)
tmp = length(x) # We calculate derivtive for all elements in gradient
if alg_autodiff(alg) isa AutoForwardDiff
tag = DiffEqBase.promote_dual(eltype(df), typeof(x))
T = if standardtag(alg)
typeof(ForwardDiff.Tag(OrdinaryDiffEqTag(), eltype(x)))
typeof(ForwardDiff.Tag(OrdinaryDiffEqTag(), tag))
else
typeof(ForwardDiff.Tag(f, eltype(x)))
typeof(ForwardDiff.Tag(f, tag))
end
xdual = Dual{T, eltype(x), 1}(x,
ForwardDiff.Partials((one(eltype(x)),)))
xdual = Dual{T, tag, 1}(convert(tag, x),
ForwardDiff.Partials((oneunit(tag),)))

if integrator.iter == 1
try
Expand Down

0 comments on commit 8568216

Please sign in to comment.