Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
set _scale in Trainer using optimizer rescale_grad
Browse files Browse the repository at this point in the history
  • Loading branch information
yuxihu committed Apr 2, 2019
1 parent 33b6543 commit a322530
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/mxnet/gluon/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ def __init__(self, params, optimizer, optimizer_params=None, kvstore='device',
self._contains_sparse_grad = True
self._compression_params = compression_params
optimizer_params = optimizer_params if optimizer_params else {}
self._scale = float(optimizer_params.get('rescale_grad', 1.0))
self._contexts = self._check_contexts()
self._init_optimizer(optimizer, optimizer_params)
self._scale = self._optimizer.rescale_grad
self._contexts = self._check_contexts()
self._kvstore_params = {'kvstore': kvstore, 'update_on_kvstore': update_on_kvstore}
self._kv_initialized = False
self._kvstore = None
Expand Down

0 comments on commit a322530

Please sign in to comment.