未验证 提交 d03b0b16 编写于 作者: Y Yuang Liu 提交者: GitHub

Add fleet get_loss_scaling doc and update alert message (#32419)

上级 f12c943a
......@@ -1059,6 +1059,8 @@ class Fleet(object):
return amp_optimizer
def get_loss_scaling(self):
"""Return the real-time loss scaling factor.
"""
amp_optimizer = self._get_amp_optimizer()
return amp_optimizer.get_loss_scaling()
......
......@@ -98,7 +98,7 @@ class OptimizerWithMixedPrecision(object):
def get_loss_scaling(self):
"""Return the real-time loss scaling factor.
"""
assert self._loss_scaling is not None, 'Call minimize() before calling get_loss_scaling()'
assert self._loss_scaling is not None, 'Please call minimize() before calling get_loss_scaling().'
return self._loss_scaling
def get_scaled_loss(self):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册