Skip to content

Commit

Permalink
Fix: Do not copy integers in struct
Browse files Browse the repository at this point in the history
  • Loading branch information
michel2323 committed Feb 5, 2023
1 parent ba18200 commit 3985a2d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Checkpointing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ end

function copyto!(dest::MT, src::TT) where {MT,TT}
for name in (fieldnames(MT))
if !isa(src[name], ChainRulesCore.ZeroTangent)
if !isa(src[name], ChainRulesCore.ZeroTangent) && !isa(getfield(dest,name), Int)
setfield!(dest, name, convert(typeof(getfield(dest, name)), src[name]))
end
end
Expand Down

0 comments on commit 3985a2d

Please sign in to comment.