Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hongxiang.cai committed Dec 24, 2020
1 parent 8eeffa0 commit fb992ac
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion vedacore/misc/checkpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,9 @@ def optimizer_to_cpu(state_dict):
for key, val in state_dict.items():
tmp = dict()
for k, v in val.items():
tmp[k] = v.cpu()
if isinstance(v, torch.Tensor):
v = v.cpu()
tmp[k] = v
state_dict_cpu[key] = tmp
return state_dict_cpu

Expand Down

0 comments on commit fb992ac

Please sign in to comment.