Skip to content

Commit 602a747

Browse files
fix: fix ADing through ReconstructInitializeprob
1 parent 5f9f20e commit 602a747

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/systems/problem_utils.jl

+3-1
Original file line numberDiff line numberDiff line change
@@ -695,8 +695,10 @@ function ReconstructInitializeprob(
695695
getters = (tunable_getter, Returns(SizedVector{0, Float64}()), rest_getters...)
696696
getter = let getters = getters
697697
function _getter(valp, initprob)
698+
oldcache = parameter_values(initprob).caches
698699
MTKParameters(getters[1](valp), getters[2](valp), getters[3](valp),
699-
getters[4](valp), getters[5](valp), copy.(parameter_values(initprob).caches))
700+
getters[4](valp), getters[5](valp), oldcache isa Tuple{} ? () :
701+
copy.(oldcache))
700702
end
701703
end
702704
else

0 commit comments

Comments
 (0)