From 46dc0ab320cdd2cf44143db781c19d4c6738b956 Mon Sep 17 00:00:00 2001 From: jClugstor Date: Mon, 11 Nov 2024 15:46:10 -0500 Subject: [PATCH] allow for Values in derivative wrapper for Algs not updated yet --- lib/OrdinaryDiffEqDifferentiation/src/derivative_wrappers.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/OrdinaryDiffEqDifferentiation/src/derivative_wrappers.jl b/lib/OrdinaryDiffEqDifferentiation/src/derivative_wrappers.jl index 3eebaa7736..f6629c10c8 100644 --- a/lib/OrdinaryDiffEqDifferentiation/src/derivative_wrappers.jl +++ b/lib/OrdinaryDiffEqDifferentiation/src/derivative_wrappers.jl @@ -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 @@ -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)