@@ -196,14 +196,14 @@ function instantiate_function(
196196 end
197197
198198 if hv == true && f. hv === nothing
199- prep_hvp = prepare_hvp (_f, soadtype. dense_ad, x, zeros (eltype (x), size (x)))
199+ prep_hvp = prepare_hvp (_f, soadtype. dense_ad, x, ( zeros (eltype (x), size (x)), ))
200200 function hv! (H, θ, v)
201- hvp! (_f, H, prep_hvp, soadtype. dense_ad, θ, v )
201+ only ( hvp! (_f, (H,), prep_hvp, soadtype. dense_ad, θ, (v,)) )
202202 end
203203 if p != = SciMLBase. NullParameters () && p != = nothing
204204 function hv! (H, θ, v, p)
205205 global _p = p
206- hvp! (_f, H, prep_hvp, soadtype. dense_ad, θ, v )
206+ only ( hvp! (_f, (H,), prep_hvp, soadtype. dense_ad, θ, (v,)) )
207207 end
208208 end
209209 elseif hv == true
@@ -253,9 +253,9 @@ function instantiate_function(
253253
254254 if f. cons_vjp === nothing && cons_vjp == true && cons != = nothing
255255 prep_pullback = prepare_pullback (
256- cons_oop, adtype. dense_ad, x, ones (eltype (x), num_cons))
256+ cons_oop, adtype. dense_ad, x, ( ones (eltype (x), num_cons), ))
257257 function cons_vjp! (J, θ, v)
258- pullback! (cons_oop, J, prep_pullback, adtype. dense_ad, θ, v )
258+ only ( pullback! (cons_oop, (J,), prep_pullback, adtype. dense_ad, θ, (v,)) )
259259 end
260260 elseif cons_vjp === true && cons != = nothing
261261 cons_vjp! = (J, θ, v) -> f. cons_vjp (J, θ, v, p)
@@ -265,9 +265,9 @@ function instantiate_function(
265265
266266 if f. cons_jvp === nothing && cons_jvp == true && cons != = nothing
267267 prep_pushforward = prepare_pushforward (
268- cons_oop, adtype. dense_ad, x, ones (eltype (x), length (x)))
268+ cons_oop, adtype. dense_ad, x, ( ones (eltype (x), length (x)), ))
269269 function cons_jvp! (J, θ, v)
270- pushforward! (cons_oop, J, prep_pushforward, adtype. dense_ad, θ, v )
270+ only ( pushforward! (cons_oop, (J,), prep_pushforward, adtype. dense_ad, θ, (v,)) )
271271 end
272272 elseif cons_jvp === true && cons != = nothing
273273 cons_jvp! = (J, θ, v) -> f. cons_jvp (J, θ, v, p)
@@ -480,15 +480,15 @@ function instantiate_function(
480480 end
481481
482482 if hv == true && f. hv === nothing
483- prep_hvp = prepare_hvp (_f, soadtype. dense_ad, x, zeros (eltype (x), size (x)))
483+ prep_hvp = prepare_hvp (_f, soadtype. dense_ad, x, ( zeros (eltype (x), size (x)), ))
484484 function hv! (θ, v)
485- hvp (_f, prep_hvp, soadtype. dense_ad, θ, v )
485+ only ( hvp (_f, prep_hvp, soadtype. dense_ad, θ, (v,)) )
486486 end
487487
488488 if p != = SciMLBase. NullParameters () && p != = nothing
489489 function hv! (θ, v, p)
490490 global _p = p
491- hvp (_f, prep_hvp, soadtype. dense_ad, θ, v )
491+ only ( hvp (_f, prep_hvp, soadtype. dense_ad, θ, (v,)) )
492492 end
493493 end
494494 elseif hv == true
@@ -533,9 +533,9 @@ function instantiate_function(
533533
534534 if f. cons_vjp === nothing && cons_vjp == true && cons != = nothing
535535 prep_pullback = prepare_pullback (
536- cons, adtype. dense_ad, x, ones (eltype (x), num_cons))
536+ cons, adtype. dense_ad, x, ( ones (eltype (x), num_cons), ))
537537 function cons_vjp! (θ, v)
538- pullback (cons, prep_pullback, adtype. dense_ad, θ, v )
538+ only ( pullback (cons, prep_pullback, adtype. dense_ad, θ, (v,)) )
539539 end
540540 elseif cons_vjp === true && cons != = nothing
541541 cons_vjp! = (θ, v) -> f. cons_vjp (θ, v, p)
@@ -545,9 +545,9 @@ function instantiate_function(
545545
546546 if f. cons_jvp === nothing && cons_jvp == true && cons != = nothing
547547 prep_pushforward = prepare_pushforward (
548- cons, adtype. dense_ad, x, ones (eltype (x), length (x)))
548+ cons, adtype. dense_ad, x, ( ones (eltype (x), length (x)), ))
549549 function cons_jvp! (θ, v)
550- pushforward (cons, prep_pushforward, adtype. dense_ad, θ, v )
550+ only ( pushforward (cons, prep_pushforward, adtype. dense_ad, θ, (v,)) )
551551 end
552552 elseif cons_jvp === true && cons != = nothing
553553 cons_jvp! = (θ, v) -> f. cons_jvp (θ, v, p)
0 commit comments