From 6beaa1ee0c433da3efcffe94a6d34d4a5a8c4095 Mon Sep 17 00:00:00 2001 From: Avik Pal Date: Wed, 20 Dec 2023 15:16:09 -0500 Subject: [PATCH 1/2] Fix literal_getproperty for LinearSolution --- ext/SciMLBaseZygoteExt.jl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ext/SciMLBaseZygoteExt.jl b/ext/SciMLBaseZygoteExt.jl index a39bd7b00..0d322a056 100644 --- a/ext/SciMLBaseZygoteExt.jl +++ b/ext/SciMLBaseZygoteExt.jl @@ -167,6 +167,15 @@ end sol.u, solu_adjoint end +@adjoint function literal_getproperty(sol::SciMLBase.LinearSolution, ::Val{:u}) + function solu_adjoint(Δ) + zerou = zero(sol.u) + _Δ = @. ifelse(Δ === nothing, zerou, Δ) + (SciMLBase.build_linear_solution(sol.cache.alg, _Δ, sol.resid, sol.cache),) + end + sol.u, solu_adjoint +end + @adjoint function literal_getproperty(sol::SciMLBase.OptimizationSolution, ::Val{:u}) function solu_adjoint(Δ) From a222cda85198b8f1b42e89e5a062d5fa199ceea2 Mon Sep 17 00:00:00 2001 From: Avik Pal Date: Sat, 24 Feb 2024 15:06:56 -0500 Subject: [PATCH 2/2] Up Project version --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 888f0de1b..bf6ad0d73 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "SciMLBase" uuid = "0bca4576-84f4-4d90-8ffe-ffa030f20462" authors = ["Chris Rackauckas and contributors"] -version = "2.26.2" +version = "2.26.3" [deps] ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"