original_docstring: Computes the loss of the tensor from the output.
  
          We don't implement this for the generic Transformer abstraction, since loss
          functions are model and objective specific. A single model architecture could
          use a myriad of loss functions which are better left expressed by the user.
  
          Args:
              outputs (Mapping): The dictionary output from the model.
                  It could contain the loss as computed by Hugging Face,
                  or algorithms can pop the labels from the input in case
                  they modify the loss function.
              batch (Batch): The set of ground truth labels to use to compute the loss against.
  
          Returns:
              The loss as a ``Tensors`` object.
  
          Raises:
              NotImplementedError: A model-specific and task-specific loss function must be written.
          
docstring: Computes the loss of the tensor from the output.
  We don't implement this for the generic Transformer abstraction, since loss
  functions are model and objective specific. A single model architecture could
  use a myriad of loss functions which are better left expressed by the user.
docstring_tokens: Computes the loss of the tensor from the output . We don ' t implement this for the generic Transformer abstraction since loss functions are model and objective specific . A single model architecture could use a myriad of loss functions which are better left expressed by the user .
code: def loss(self, outputs: Mapping, batch: Batch) -> Tensors:
          """Computes the loss of the tensor from the output.
  
          We don't implement this for the generic Transformer abstraction, since loss
          functions are model and objective specific. A single model architecture could
          use a myriad of loss functions which are better left expressed by the user.
  
          Args:
              outputs (Mapping): The dictionary output from the model.
                  It could contain the loss as computed by Hugging Face,
                  or algorithms can pop the labels from the input in case
                  they modify the loss function.
              batch (Batch): The set of ground truth labels to use to compute the loss against.
  
          Returns:
              The loss as a ``Tensors`` object.
  
          Raises:
              NotImplementedError: A model-specific and task-specific loss function must be written.
          """
  
          raise NotImplementedError("A model-specific loss function must be written.")
code_tokens: def loss ( self , outputs : Mapping , batch : Batch ) -> Tensors : raise NotImplementedError ( "A model-specific loss function must be written." )
short_docstring: Computes the loss of the tensor from the output.
short_docstring_tokens: Computes the loss of the tensor from the output .
comment: """Computes the loss of the tensor from the output.
  
          We don't implement this for the generic Transformer abstraction, since loss
          functions are model and objective specific. A single model architecture could
          use a myriad of loss functions which are better left expressed by the user.
  
          Args:
              outputs (Mapping): The dictionary output from the model.
                  It could contain the loss as computed by Hugging Face,
                  or algorithms can pop the labels from the input in case
                  they modify the loss function.
              batch (Batch): The set of ground truth labels to use to compute the loss against.
  
          Returns:
              The loss as a ``Tensors`` object.
  
          Raises:
              NotImplementedError: A model-specific and task-specific loss function must be written.
          """