Skip to content

Commit 25efa16

Browse files
committed
fix: autodiff cannot be nothing
1 parent 5ad2fb2 commit 25efa16

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/internal/jacobian.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,9 @@ function JacobianCache(prob, alg, f::F, fu_, u, p; stats, autodiff = nothing,
5858

5959
@bb fu = similar(fu_)
6060

61+
autodiff = get_concrete_forward_ad(autodiff, prob; check_forward_mode = false)
62+
6163
if !has_analytic_jac && needs_jac
62-
autodiff = get_concrete_forward_ad(autodiff, prob; check_forward_mode = false)
6364
sd = sparsity_detection_alg(f, autodiff)
6465
sparse_jac = !(sd isa NoSparsityDetection)
6566
# Eventually we want to do everything via DI. But for now, we just do the dense via DI

0 commit comments

Comments
 (0)