File tree Expand file tree Collapse file tree 1 file changed +16
-9
lines changed
lib/OrdinaryDiffEqCore/src Expand file tree Collapse file tree 1 file changed +16
-9
lines changed Original file line number Diff line number Diff line change @@ -75,14 +75,21 @@ function SciMLBase.strip_interpolation(id::InterpolationData)
75
75
end
76
76
77
77
function strip_cache (cache)
78
- if hasfield (typeof (cache), :jac_config ) || hasfield (typeof (cache), :grad_config ) ||
79
- hasfield (typeof (cache), :nlsolver ) || hasfield (typeof (cache), :tf ) ||
80
- hasfield (typeof (cache), :uf )
81
- fieldnums = length (fieldnames (typeof (cache)))
82
- noth_list = fill (nothing , fieldnums)
83
- cache_type_name = Base. typename (typeof (cache)). wrapper
84
- cache_type_name (noth_list... )
85
- else
86
- cache
78
+ if hasfield (typeof (cache), :jac_config )
79
+ SciMLBase. @reset cache. jac_config = nothing
87
80
end
81
+ if hasfield (typeof (cache), :grad_config )
82
+ SciMLBase. @reset cache. grad_config = nothing
83
+ end
84
+ if hasfield (typeof (cache), :nlsolver )
85
+ SciMLBase. @reset cache. nlsolver = nothing
86
+ end
87
+ if hasfield (typeof (cache), :tf )
88
+ SciMLBase. @reset cache. tf = nothing
89
+ end
90
+ if hasfield (typeof (cache), :uf )
91
+ SciMLBase. @reset cache. uf = nothing
92
+ end
93
+
94
+ cache
88
95
end
You can’t perform that action at this time.
0 commit comments