Skip to content

Commit 6beaa1e

Browse files
avik-palAvik Pal
authored andcommitted
Fix literal_getproperty for LinearSolution
1 parent 1774538 commit 6beaa1e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

ext/SciMLBaseZygoteExt.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,15 @@ end
167167
sol.u, solu_adjoint
168168
end
169169

170+
@adjoint function literal_getproperty(sol::SciMLBase.LinearSolution, ::Val{:u})
171+
function solu_adjoint(Δ)
172+
zerou = zero(sol.u)
173+
= @. ifelse=== nothing, zerou, Δ)
174+
(SciMLBase.build_linear_solution(sol.cache.alg, _Δ, sol.resid, sol.cache),)
175+
end
176+
sol.u, solu_adjoint
177+
end
178+
170179
@adjoint function literal_getproperty(sol::SciMLBase.OptimizationSolution,
171180
::Val{:u})
172181
function solu_adjoint(Δ)

0 commit comments

Comments
 (0)