class_docstr: A Wrapper for tf.train.Optimizer.
  
  Automatically takes care of:
  - Gradient averaging for multi-GPU training.
  - Gradient accumulation for arbitrarily large minibatches.
  - Dynamic loss scaling and typecasts for FP16 training.
  - Ignoring corrupted gradients that contain NaNs/Infs.
  - Reporting statistics.
  - Well-chosen default settings.
class_docstr_tok: ["A","Wrapper","for","tf.train.Optimizer",".","Automatically","takes","care","of",":","-","Gradient","averaging","for","multi-GPU","training",".","-","Gradient","accumulation","for","arbitrarily","large","minibatches",".","-","Dynamic","loss","scaling","and","typecasts","for","FP16","training",".","-","Ignoring","corrupted","gradients","that","contain","NaNs\/Infs",".","-","Reporting","statistics",".","-","Well-chosen","default","settings","."]
docstr: Apply dynamic loss scaling for the given expression.
docstr_tok: ["Apply","dynamic","loss","scaling","for","the","given","expression","."]
code: def apply_loss_scaling(self, value: TfExpression) -> TfExpression:
      """Apply dynamic loss scaling for the given expression."""
      assert tfutil.is_tf_expression(value)
      if not self.use_loss_scaling:
          return value
      return value * tfutil.exp2(
          self.get_loss_scaling_var(value.device)
      )
  
imports: import numpy
  import tensorflow
  from collections import OrderedDict
  from typing import List, Union
  from .None import autosummary
  from .None import tfutil
  from ..None import util
  from .tfutil import TfExpression, TfExpressionEx
label_desc: Use image node_id 7 for calling the Optimizer obj's underlying member method code with example usage: obj.apply_loss_scaling(value) and returns: unknown, value