class_docstr: Base class for the losses in order to combine commonly used methods.
class_docstr_tok: ["Base","class","for","the","losses","in","order","to","combine","commonly","used","methods","."]
docstr: Pure abstract method that computes the loss.
  
  Args:
      prediction: Prediction that was made by the model of shape
                  [BATCH_SIZE, N_LABELS]
      target: Expected result of shape [BATCH_SIZE, N_OUTPUT_TOKENS]
  Returns:
      loss: This method should return the loss as a Tensor or Variable.
docstr_tok: ["Pure","abstract","method","that","computes","the","loss",".","Args",":","prediction",":","Prediction","that","was","made","by","the","model","of","shape","[","BATCH_SIZE",",","N_LABELS","]","target",":","Expected","result","of","shape","[","BATCH_SIZE",",","N_OUTPUT_TOKENS","]","Returns",":","loss",":","This","method","should","return","the","loss","as","a","Tensor","or","Variable","."]
code: def predictor_loss_function(
      self, prediction, target, *args, **kwargs
  ):
      """Pure abstract method that computes the loss.
  
      Args:
          prediction: Prediction that was made by the model of shape
                      [BATCH_SIZE, N_LABELS]
          target: Expected result of shape [BATCH_SIZE, N_OUTPUT_TOKENS]
      Returns:
          loss: This method should return the loss as a Tensor or Variable.
      """
      return torch.Tensor(float("Inf"))
  
imports: import abc
  import math
  import torch
  from fairseq import utils
  from fairseq.criterions import register_criterion
  from fairseq.criterions.label_smoothed_cross_entropy import LabelSmoothedCrossEntropyCriterion
  from pytorch_translate.utils import maybe_cuda
label_desc: Use image node_id 1 for calling the _BasePredictionCriterion obj's underlying member method code with example usage: obj.predictor_loss_function(prediction, target) and returns: torch