[hotfix] add correct device for fake_param (#2796)

This commit is contained in:
HELSON
2023-02-17 15:29:07 +08:00
committed by GitHub
parent a619a190df
commit 56ddc9ca7a
2 changed files with 3 additions and 4 deletions

View File

@@ -70,8 +70,6 @@ def exam_zero_optim_state_dict(placement_policy, keep_gathered):
for n, m in v.items():
if isinstance(m, torch.Tensor):
o = w[n]
if m.device != o.device:
o = o.to(m.device)
assert torch.equal(m, o)
else:
assert m == w[n]