Skip to content

Commit

Permalink
Update adjoint_common.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhishek-1Bhatt committed Jul 11, 2022
1 parent 6158ba9 commit a2d90fd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/adjoint_common.jl
Original file line number Diff line number Diff line change
Expand Up @@ -412,12 +412,12 @@ function (f::ReverseLossCallback)(integrator)
gᵤ = isq ? λ : @view(λ[1:idx])
if dgdu !== nothing
dgdu(gᵤ, y, p, t[cur_time[]], cur_time[])
# add discrete dgdp contribution
if dgdp !== nothing && !isq
gp = @view(λ[(idx + 1):end])
dgdp(gp, y, p, t[cur_time[]], cur_time[])
u[(idx + 1):length(λ)] .+= gp
end
# add discrete dgdp contribution
if dgdp !== nothing && !isq
gp = @view(λ[(idx + 1):end])
dgdp(gp, y, p, t[cur_time[]], cur_time[])
u[(idx + 1):length(λ)] .+= gp
end
end
else
@assert sensealg isa QuadratureAdjoint
Expand Down

0 comments on commit a2d90fd

Please sign in to comment.