Skip to content

Commit 89ff142

Browse files
committed
address style
Signed-off-by: Terry Kong <terryk@nvidia.com>
1 parent 567b144 commit 89ff142

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

nemo/core/optim/optimizer_with_main_params.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,10 @@ def step(self, **kwargs):
454454
if self._async_grad_allreduce:
455455
torch.cuda.synchronize()
456456

457+
closure = kwargs.pop('closure', None)
458+
# Allows applications to specify closure kwarg without erroring due to duplicate specification
459+
assert closure is None, f"closre should be None but was passed {closure}"
460+
457461
# Step the optimizer.
458462
self.optimizer.step(closure=None, **kwargs)
459463

0 commit comments

Comments
 (0)