class_docstr: A container class for losses passed to `Model.compile`.
class_docstr_tok: ["A","container","class","for","losses","passed","to","`","Model.compile","`","."]
docstr: One-time setup of loss objects.
code: def build(self, y_pred):
      """One-time setup of loss objects."""
      super(LossesContainer, self).build(y_pred)
  
      self._losses = self._maybe_broadcast_to_outputs(
          y_pred, self._losses
      )
      self._losses = self._conform_to_outputs(y_pred, self._losses)
      self._losses = nest.map_structure(
          self._get_loss_object, self._losses
      )
      self._losses = nest.flatten(self._losses)
  
      self._loss_weights = self._maybe_broadcast_to_outputs(
          y_pred, self._loss_weights
      )
      self._loss_weights = self._conform_to_outputs(
          y_pred, self._loss_weights
      )
      self._loss_weights = nest.flatten(self._loss_weights)
  
      self._create_metrics()
      self._built = True
  
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 3 for calling the LossesContainer obj's underlying member method code with example usage: obj.build(y_pred) without return types