Skip to content

Commit

Permalink
grad_config fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jClugstor committed Nov 29, 2024
1 parent 29e2b1d commit f9002b2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/OrdinaryDiffEqDifferentiation/src/derivative_wrappers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,13 @@ function resize_grad_config!(grad_config::FiniteDiff.GradientCache, i)
end

function build_grad_config(alg, f::F1, tf::F2, du1, t) where {F1, F2}
return DI.prepare_derivative(tf, du1, ADTypes.dense_ad(alg_autodiff(alg)), t)
if alg_autodiff(alg) isa AutoSparse
autodiff_alg = ADTypes.dense_ad(alg_autodiff(alg))
else
autodiff_alg = alg_autodiff(alg)
end

return DI.prepare_derivative(tf, du1, autodiff_alg, t)
end

function sparsity_colorvec(f, x)
Expand Down

0 comments on commit f9002b2

Please sign in to comment.