Skip to content

Commit 6c893d2

Browse files
Update SciMLJacobianOperators.jl
1 parent 3f1bc27 commit 6c893d2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/SciMLJacobianOperators/src/SciMLJacobianOperators.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -307,14 +307,14 @@ function prepare_vjp(::Val{false}, prob::AbstractNonlinearProblem,
307307
@assert DI.check_inplace(autodiff) "Backend: $(autodiff) doesn't support in-place \
308308
problems."
309309
fu_cache = copy(fu)
310-
di_extras = DI.prepare_pullback(f, fu_cache, autodiff, u, (fu,), Constant(prob.p))
310+
di_extras = DI.prepare_pullback(f, fu_cache, autodiff, u, (fu,), Constant(prob.p), strict=Val(false))
311311
return @closure (vJ, v, u, p) -> begin
312312
DI.pullback!(f, fu_cache, (reshape(vJ, size(u)),), di_extras, autodiff,
313313
u, (reshape(v, size(fu_cache)),), Constant(p))
314314
return
315315
end
316316
else
317-
di_extras = DI.prepare_pullback(f, autodiff, u, (fu,), Constant(prob.p))
317+
di_extras = DI.prepare_pullback(f, autodiff, u, (fu,), Constant(prob.p), strict=Val(false))
318318
return @closure (v, u, p) -> begin
319319
return only(DI.pullback(
320320
f, di_extras, autodiff, u, (reshape(v, size(fu)),), Constant(p)))
@@ -352,14 +352,14 @@ function prepare_jvp(::Val{false}, prob::AbstractNonlinearProblem,
352352
@assert DI.check_inplace(autodiff) "Backend: $(autodiff) doesn't support in-place \
353353
problems."
354354
fu_cache = copy(fu)
355-
di_extras = DI.prepare_pushforward(f, fu_cache, autodiff, u, (u,), Constant(prob.p))
355+
di_extras = DI.prepare_pushforward(f, fu_cache, autodiff, u, (u,), Constant(prob.p), strict=Val(false))
356356
return @closure (Jv, v, u, p) -> begin
357357
DI.pushforward!(f, fu_cache, (reshape(Jv, size(fu_cache)),), di_extras,
358358
autodiff, u, (reshape(v, size(u)),), Constant(p))
359359
return
360360
end
361361
else
362-
di_extras = DI.prepare_pushforward(f, autodiff, u, (u,), Constant(prob.p))
362+
di_extras = DI.prepare_pushforward(f, autodiff, u, (u,), Constant(prob.p), strict=Val(false))
363363
return @closure (v, u, p) -> begin
364364
return only(DI.pushforward(
365365
f, di_extras, autodiff, u, (reshape(v, size(u)),), Constant(p)))
@@ -375,7 +375,7 @@ function prepare_scalar_op(::Val{false}, prob::AbstractNonlinearProblem,
375375

376376
@assert autodiff!==nothing "`autodiff` must be provided if `f` doesn't have \
377377
analytic `vjp` or `jvp` or `jac`."
378-
di_extras = DI.prepare_derivative(f, autodiff, u, Constant(prob.p))
378+
di_extras = DI.prepare_derivative(f, autodiff, u, Constant(prob.p), strict=Val(false))
379379
return @closure (v, u, p) -> DI.derivative(f, di_extras, autodiff, u, Constant(p)) * v
380380
end
381381

0 commit comments

Comments
 (0)