Skip to content

Commit

Permalink
allow for Values in derivative wrapper for Algs not updated yet
Browse files Browse the repository at this point in the history
  • Loading branch information
jClugstor committed Nov 11, 2024
1 parent 9ff23f1 commit 46dc0ab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/OrdinaryDiffEqDifferentiation/src/derivative_wrappers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function derivative!(df::AbstractArray{<:Number}, f,
alg = unwrap_alg(integrator, true)
tmp = length(x) # We calculate derivative for all elements in gradient
autodiff_alg = alg_autodiff(alg)
if nameof(autodiff_alg) == :AutoForwardDiff
if nameof(autodiff_alg) == :AutoForwardDiff || autodiff_alg == Val{true}
T = if standardtag(alg)
typeof(ForwardDiff.Tag(OrdinaryDiffEqTag(), eltype(df)))
else
Expand All @@ -103,7 +103,7 @@ function derivative!(df::AbstractArray{<:Number}, f,

df .= first.(ForwardDiff.partials.(grad_config))
OrdinaryDiffEqCore.increment_nf!(integrator.stats, 1)
elseif nameof(autodiff_alg) == :AutoFiniteDiff
elseif nameof(autodiff_alg) == :AutoFiniteDiff || autodiff_alg == Val{false}
FiniteDiff.finite_difference_gradient!(df, f, x, grad_config,
dir = diffdir(integrator))
fdtype = alg_difftype(alg)
Expand Down

0 comments on commit 46dc0ab

Please sign in to comment.