Skip to content

Commit

Permalink
add update
Browse files Browse the repository at this point in the history
  • Loading branch information
ForFishes committed Sep 23, 2021
1 parent 1548407 commit 944eaff
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ def _broadcast_final_loss(self):
def _optimizer_step(self):
if self.scaler:
self.scaler.step(self.optimizer)
self.scaler.update()
else:
self.optimizer.step()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def train_batch(self, batch, model, optimizer, is_mp):
scaled.backward() # do backward

scaler.step(optimizer) # update parameters
scaler.update()
optimizer.clear_grad()
return scaled

Expand Down

1 comment on commit 944eaff

@paddle-bot-old
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Congratulation! Your pull request passed all required CI. You could ask reviewer(s) to approve and merge. 🎉

Please sign in to comment.