Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/gauss_adjoint.jl
Original file line number Diff line number Diff line change
Expand Up @@ -457,8 +457,18 @@ function GaussIntegrand(sol, sensealg, checkpoints, dgdp = nothing)
u0 = state_values(prob)
p = parameter_values(prob)

if p === nothing || p isa SciMLBase.NullParameters
# if p === nothing || p isa SciMLBase.NullParameters
# tunables, repack = p, identity

# minimal fix 4 for #995
#---------------------------------------------------
if p === nothing
tunables = Float64[] # 0-length, Functors-safe
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this isn't necessarily typed correctly, and would result in doing unnecessary computations

repack = _ -> nothing # preserve original semantics
elseif p isa SciMLBase.NullParameters
tunables, repack = p, identity
#----------------------------------------------------

elseif isscimlstructure(p)
tunables, repack, _ = canonicalize(Tunable(), p)
elseif isfunctor(p)
Expand Down
Loading