Skip to content

Commit

Permalink
fix: autodiff cannot be nothing
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal committed Sep 27, 2024
1 parent 5ad2fb2 commit 25efa16
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/internal/jacobian.jl
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ function JacobianCache(prob, alg, f::F, fu_, u, p; stats, autodiff = nothing,

@bb fu = similar(fu_)

autodiff = get_concrete_forward_ad(autodiff, prob; check_forward_mode = false)

if !has_analytic_jac && needs_jac
autodiff = get_concrete_forward_ad(autodiff, prob; check_forward_mode = false)
sd = sparsity_detection_alg(f, autodiff)
sparse_jac = !(sd isa NoSparsityDetection)
# Eventually we want to do everything via DI. But for now, we just do the dense via DI
Expand Down

0 comments on commit 25efa16

Please sign in to comment.