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 (#14593)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuxihu authored and nswamy committed Apr 5, 2019
1 parent 3414b06 commit d843a85
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 @@ -95,10 +95,10 @@ def __init__(self, params, optimizer, optimizer_params=None, kvstore='device',
if param._grad_stype != 'default':
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()
optimizer_params = optimizer_params if optimizer_params else {}
self._init_optimizer(optimizer, optimizer_params)
self._scale = self._optimizer.rescale_grad
self._kvstore_params = {'kvstore': kvstore, 'update_on_kvstore': update_on_kvstore}
self._kv_initialized = False
self._kvstore = None
Expand Down

0 comments on commit d843a85

Please sign in to comment.