Skip to content

Commit ff9bb2c

Browse files
chore: revert literal_getproperty adjoint
1 parent a417cdd commit ff9bb2c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

ext/SciMLBaseZygoteExt.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,16 @@ end
215215
NonlinearSolution{T, N, uType, R, P, A, O, uType2}(u, args...), NonlinearSolutionAdjoint
216216
end
217217

218+
@adjoint function literal_getproperty(sol::AbstractTimeseriesSolution,
219+
::Val{:u})
220+
function solu_adjoint(Δ)
221+
zerou = zero(sol.prob.u0)
222+
= @. ifelse=== nothing, (zerou,), Δ)
223+
(build_solution(sol.prob, sol.alg, sol.t, _Δ),)
224+
end
225+
sol.u, solu_adjoint
226+
end
227+
218228
@adjoint function literal_getproperty(sol::SciMLBase.AbstractNoTimeSolution,
219229
::Val{:u})
220230
function solu_adjoint(Δ)

0 commit comments

Comments
 (0)