Unverified Commit 2215fa5c authored by Alexandros Koumparoulis's avatar Alexandros Koumparoulis Committed by GitHub
Browse files

don't put master_param to state if None (#1130)


Signed-off-by: default avatarAlexandros Koumparoulis <akoumparouli@nvidia.com>
parent 309c6d49
......@@ -219,10 +219,8 @@ class FusedAdam(torch.optim.Optimizer):
assert (
state["master_param"].shape == p.shape
), "Master weights shape must match model weights shape"
else:
state["master_param"] = None
p_master = state["master_param"]
p_master = state.get("master_param", None)
p_grad = p.grad
if self.master_weights and p_master is not None and p_master.grad is not None:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment