Skip to content

Commit 61d69f5

Browse files
Fix _func_cache type promotion in remake
Fixes downstream AD tests
1 parent 9e6d0e3 commit 61d69f5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/remake.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ function remake(
137137
spec = specialization(func)
138138
# retain properties of original function
139139
props = getproperties(func)
140+
forig = f
140141

141142
if f === missing || is_split_function(func)
142143
# if no `f` is provided, create the same type of SciMLFunction
@@ -183,7 +184,14 @@ function remake(
183184
if !(f2 isa Union{AbstractSciMLOperator, split_function_f_wrapper(T)})
184185
f2 = split_function_f_wrapper(T){iip, spec}(f2)
185186
end
187+
186188
props = @delete props.f2
189+
190+
if !ismissing(forig)
191+
props = @delete props._func_cache
192+
props = @insert props._func_cache = forig._func_cache
193+
end
194+
187195
args = (args..., f2)
188196
end
189197
end

0 commit comments

Comments
 (0)