Skip to content

Commit

Permalink
Fix type stability in getadjointsensitivities
Browse files Browse the repository at this point in the history
  • Loading branch information
mjohnson541 committed Feb 7, 2024
1 parent 691fe40 commit 43de642
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Simulation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import SciMLBase: AbstractODESolution, HermiteInterpolation, AbstractDiffEqInter
using SciMLSensitivity
using ForwardDiff
using PreallocationTools
using LinearAlgebra

abstract type AbstractSimulation end
export AbstractSimulation
Expand Down Expand Up @@ -561,7 +562,7 @@ function getadjointsensitivities(bsol::Simulation, target::String, solver; sensa
dpadj ./= bsol.sol(bsol.sol.t[end])[ind]
end
end
return dpadj
return dpadj::LinearAlgebra.Adjoint{Float64, Vector{Float64}}
end

function getadjointsensitivities(syssim::Q, bsol::W3, target::String, solver::W; sensalg::W2=InterpolatingAdjoint(autojacvec=ReverseDiffVJP(false)),
Expand Down Expand Up @@ -605,7 +606,7 @@ function getadjointsensitivities(syssim::Q, bsol::W3, target::String, solver::W;
dpadj ./= bsol.sol(bsol.sol.t[end])[ind]
end
end
return dpadj
return dpadj::LinearAlgebra.Adjoint{Float64, Vector{Float64}}
end
export getadjointsensitivities

Expand Down

0 comments on commit 43de642

Please sign in to comment.