class_docstr: Output layer for document classification models.
  It supports `CrossEntropyLoss` and `BinaryCrossEntropyLoss` per document.
  
  Args:
      loss_fn (Union[CrossEntropyLoss, BinaryCrossEntropyLoss]):
          The loss function to use for computing loss. Defaults to None.
  
  Attributes:
      loss_fn: The loss function to use for computing loss.
docstr: Compute and return prediction and scores from the model.
  
  Prediction is computed using argmax over the document label/target space.
  
  Scores are sigmoid or softmax scores over the model logits depending on
  the loss component being used.
  
  Args:
      logit (torch.Tensor): Logits returned
          :class:`~pytext.models.doc_model.DocModel`.
  
  Returns:
      Tuple[torch.Tensor, torch.Tensor]: Model prediction and scores.
docstr_tok: ["Compute","and","return","prediction","and","scores","from","the","model",".","Prediction","is","computed","using","argmax","over","the","document","label\/target","space",".","Scores","are","sigmoid","or","softmax","scores","over","the","model","logits","depending","on","the","loss","component","being","used",".","Args",":","logit","(","torch.Tensor",")",":","Logits","returned",":","class",":","`","~pytext.models.doc_model.DocModel","`",".","Returns",":","Tuple","[","torch.Tensor",",","torch.Tensor","]",":","Model","prediction","and","scores","."]
code: def get_pred(self, logit, *args, **kwargs):
      """Compute and return prediction and scores from the model.
  
      Prediction is computed using argmax over the document label/target space.
  
      Scores are sigmoid or softmax scores over the model logits depending on
      the loss component being used.
  
      Args:
          logit (torch.Tensor): Logits returned
              :class:`~pytext.models.doc_model.DocModel`.
  
      Returns:
          Tuple[torch.Tensor, torch.Tensor]: Model prediction and scores.
  
      """
      raise NotImplementedError
  
imports: from typing import Dict, List, Optional, Union
  import torch
  import torch.nn.functional
  from caffe2.python import core
  from pytext.common import Padding
  from pytext.config.component import create_loss
  from pytext.data.utils import Vocabulary
  from pytext.fields import FieldMeta
  from pytext.loss import AUCPRHingeLoss, BinaryCrossEntropyLoss, BinaryCrossEntropyWithLogitsLoss, CrossEntropyLoss, HingeLoss, KLDivergenceBCELoss, KLDivergenceCELoss, LabelSmoothedCrossEntropyLoss, MultiLabelSoftMarginLoss
  from pytext.utils.label import get_custom_or_automatic_label_weights
  from pytext.utils.typing import WeightingMethod
  from torch import jit
  from .output_layer_base import OutputLayerBase
  from .utils import OutputLayerUtils
label_desc: Use image node_id 2 for calling the ClassificationOutputLayer obj's underlying member method code with example usage: obj.get_pred(logit) without return types