From b4d8029875db2c1df064076fca9010ebd2affb39 Mon Sep 17 00:00:00 2001 From: Avik Pal Date: Mon, 23 Sep 2024 19:36:17 -0400 Subject: [PATCH] fix: return the result always --- .../src/SciMLJacobianOperators.jl | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/SciMLJacobianOperators/src/SciMLJacobianOperators.jl b/lib/SciMLJacobianOperators/src/SciMLJacobianOperators.jl index fceaea278..8cb51a30f 100644 --- a/lib/SciMLJacobianOperators/src/SciMLJacobianOperators.jl +++ b/lib/SciMLJacobianOperators/src/SciMLJacobianOperators.jl @@ -150,18 +150,17 @@ function (op::JacobianOperator)(Jv, v, u, p) if op.mode isa VJP if SciMLBase.isinplace(op) op.vjp_op(Jv, v, u, p) - return + else + copyto!(Jv, op.vjp_op(v, u, p)) end - copyto!(Jv, op.vjp_op(v, u, p)) - return else if SciMLBase.isinplace(op) op.jvp_op(Jv, v, u, p) - return + else + copyto!(Jv, op.jvp_op(v, u, p)) end - copyto!(Jv, op.jvp_op(v, u, p)) - return end + return Jv end """