Skip to content

Commit

Permalink
fix: grad clip fn param in AMPOptimizerCallback (#948)
Browse files Browse the repository at this point in the history
  • Loading branch information
bagxi committed Sep 29, 2020
1 parent 23307f6 commit f5aeacc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).

### Fixed

-
- `AMPOptimizerCallback` - fix grad clip fn support ([#948](https://github.com/catalyst-team/catalyst/pull/948))
-


## [20.09.1] - 2020-09-25
Expand Down
2 changes: 1 addition & 1 deletion catalyst/core/callbacks/optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ def grad_step(
# Unscales the gradients of
# optimizer's assigned params in-place
self.scaler.unscale_(optimizer)
for group in zip(optimizer.param_groups):
for group in optimizer.param_groups:
# Since the gradients of optimizer's
# assigned params are unscaled, clips as usual:
grad_clip_fn(group["params"])
Expand Down

0 comments on commit f5aeacc

Please sign in to comment.