class_docstr: A container class for losses passed to `Model.compile`.
class_docstr_tok: ["A","container","class","for","losses","passed","to","`","Model.compile","`","."]
docstr: Returns a `Loss` object.
  
  Converts the user-supplied loss to a `Loss` object. Also allows
  `SUM_OVER_BATCH_SIZE` reduction to be used for this loss.
  
  Args:
    loss: A string, function, or `Loss` object.
  
  Returns:
    A `Loss` object.
code: def _get_loss_object(self, loss):
      """Returns a `Loss` object.
  
      Converts the user-supplied loss to a `Loss` object. Also allows
      `SUM_OVER_BATCH_SIZE` reduction to be used for this loss.
  
      Args:
        loss: A string, function, or `Loss` object.
  
      Returns:
        A `Loss` object.
      """
      if loss is None:
          return None  # Ok to have no loss for an output.
  
      loss = losses_mod.get(loss)
      if not isinstance(loss, losses_mod.Loss):
          loss_name = get_custom_object_name(loss)
          if loss_name is None:
              raise ValueError(
                  "Loss should be a callable, found: {}".format(loss)
              )
          loss = losses_mod.LossFunctionWrapper(loss, name=loss_name)
      loss._allow_sum_over_batch_size = (
          True  # pylint: disable=protected-access
      )
      return loss
  
imports: import copy
  from tensorflow.python.distribute import distribute_lib
  from tensorflow.python.keras import losses
  from tensorflow.python.keras import metrics
  from tensorflow.python.keras.utils import generic_utils
  from tensorflow.python.keras.utils import losses_utils
  from tensorflow.python.keras.utils import tf_utils
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.util import nest
label_desc: Use image node_id 8 for calling the LossesContainer obj's underlying member method code with example usage: obj._get_loss_object(loss) and returns: loss, None