@@ -185,12 +185,12 @@ function __solvebp_call(prob::QuadratureProblem,::HCubatureJL,sensealg,lb,ub,p,a
185
185
186
186
if lb isa Number
187
187
val,err = hquadrature (f, lb, ub;
188
- rtol= reltol, atol= abstol,
189
- maxevals= maxiters, initdiv = 1 )
188
+ rtol= reltol, atol= abstol,
189
+ maxevals= maxiters, kwargs ... )
190
190
else
191
191
val,err = hcubature (f, lb, ub;
192
192
rtol= reltol, atol= abstol,
193
- maxevals= maxiters, initdiv = 1 )
193
+ maxevals= maxiters, kwargs ... )
194
194
end
195
195
DiffEqBase. build_solution (prob,HCubatureJL (),val,err,retcode = :Success )
196
196
end
@@ -490,7 +490,7 @@ ZygoteRules.@adjoint function __solvebp(prob,alg,sensealg,lb,ub,p,args...;kwargs
490
490
function quadrature_adjoint (Δ)
491
491
y = typeof (Δ) <: Array{<:Number,0} ? Δ[1 ] : Δ
492
492
if isinplace (prob)
493
- dx = zeros (prob. nout)
493
+ dx = zeros (prob. nout)
494
494
_f = (x) -> prob. f (dx,x,p)
495
495
if sensealg. vjp isa ZygoteVJP
496
496
dfdp = function (dx,x,p)
@@ -500,8 +500,8 @@ ZygoteRules.@adjoint function __solvebp(prob,alg,sensealg,lb,ub,p,args...;kwargs
500
500
copy (_dx)
501
501
end
502
502
503
- z = zeros (size (x,2 ))
504
- for idx in 1 : size (x,2 )
503
+ z = zeros (size (x,2 ))
504
+ for idx in 1 : size (x,2 )
505
505
z[1 ] = 1
506
506
dx[:,idx] = back (z)[1 ]
507
507
z[idx]= 0
@@ -516,13 +516,13 @@ ZygoteRules.@adjoint function __solvebp(prob,alg,sensealg,lb,ub,p,args...;kwargs
516
516
if prob. batch > 0
517
517
dfdp = function (x,p)
518
518
_,back = Zygote. pullback (p-> prob. f (x,p),p)
519
-
519
+
520
520
out = zeros (length (p),size (x,2 ))
521
521
z = zeros (size (x,2 ))
522
522
for idx in 1 : size (x,2 )
523
523
z[idx] = 1
524
524
out[:,idx] = back (z)[1 ]
525
- z[idx]= 0
525
+ z[idx]= 0
526
526
end
527
527
out
528
528
end
@@ -583,7 +583,7 @@ function __solvebp(prob,alg,sensealg,lb,ub,p::AbstractArray{<:ForwardDiff.Dual{T
583
583
if isinplace (prob)
584
584
dfdp = function (out,x,p)
585
585
dualp = reinterpret (ForwardDiff. Dual{T,V,P}, p)
586
- if prob. batch > 0
586
+ if prob. batch > 0
587
587
dx = similar (dualp, prob. nout, size (x,2 ))
588
588
else
589
589
dx = similar (dualp, prob. nout)
0 commit comments