We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7f90698 commit 18855abCopy full SHA for 18855ab
src/systems/parameter_buffer.jl
@@ -319,8 +319,8 @@ function Base.copy(p::MTKParameters)
319
initials = copy(p.initials)
320
discrete = Tuple(eltype(buf) <: Real ? copy(buf) : copy.(buf) for buf in p.discrete)
321
constant = Tuple(eltype(buf) <: Real ? copy(buf) : copy.(buf) for buf in p.constant)
322
- nonnumeric = copy.(p.nonnumeric)
323
- caches = copy.(p.caches)
+ nonnumeric = isempty(p.nonnumeric) ? p.nonnumeric : copy.(p.nonnumeric)
+ caches = isempty(p.caches) ? p.caches : copy.(p.caches)
324
return MTKParameters(
325
tunable,
326
initials,
0 commit comments