MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / _unscale_grads

Method _unscale_grads

tensorflow/python/training/optimizer.py:605–611  ·  view source on GitHub ↗
(self, grads)

Source from the content-addressed store, hash-verified

603 return loss_value
604
605 def _unscale_grads(self, grads):
606 loss_scale = self._loss_scale()
607 loss_scale_reciprical = 1 / loss_scale
608 return [
609 None if g is None else self._scale_grad(g, loss_scale_reciprical)
610 for g in grads
611 ]
612
613 def _scale_grad(self, grad, loss_scale_reciprical):
614 if isinstance(grad, ops.IndexedSlices):

Callers 1

compute_gradientsMethod · 0.95

Calls 1

_scale_gradMethod · 0.95

Tested by

no test coverage detected