class_docstr: Output layer for language models. It supports `CrossEntropyLoss` per word.
  
  Args:
      loss_fn (CrossEntropyLoss): Cross-entropy loss component. Defaults to None.
  
  Attributes:
      loss_fn: Cross-entropy loss component for computing loss.
class_docstr_tok: ["Output","layer","for","language","models",".","It","supports","`","CrossEntropyLoss","`","per","word",".","Args",":","loss_fn","(","CrossEntropyLoss",")",":","Cross-entropy","loss","component",".","Defaults","to","None",".","Attributes",":","loss_fn",":","Cross-entropy","loss","component","for","computing","loss","."]
docstr: Compute and return prediction and scores from the model.
  Prediction is computed using argmax over the word label/target space.
  Scores are softmax scores over the model logits.
  
  Args:
      logits (torch.Tensor): Logits returned
          :class:`~pytext.models.language_models.lmlstm.LMLSTM`.
      targets (torch.Tensor): True words.
  
  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","word","label\/target","space",".","Scores","are","softmax","scores","over","the","model","logits",".","Args",":","logits","(","torch.Tensor",")",":","Logits","returned",":","class",":","`","~pytext.models.language_models.lmlstm.LMLSTM","`",".","targets","(","torch.Tensor",")",":","True","words",".","Returns",":","Tuple","[","torch.Tensor",",","torch.Tensor","]",":","Model","prediction","and","scores","."]
code: def get_pred(
      self, logits: torch.Tensor, *args, **kwargs
  ) -> Tuple[torch.Tensor, torch.Tensor]:
      """Compute and return prediction and scores from the model.
      Prediction is computed using argmax over the word label/target space.
      Scores are softmax scores over the model logits.
  
      Args:
          logits (torch.Tensor): Logits returned
              :class:`~pytext.models.language_models.lmlstm.LMLSTM`.
          targets (torch.Tensor): True words.
  
      Returns:
          Tuple[torch.Tensor, torch.Tensor]: Model prediction and scores.
  
      """
      return (logits, None)
  
file_path: pytext/pytext/models/output_layers/lm_output_layer.py
imports: from typing import Any, Dict, List, Optional, Tuple
  import torch
  from pytext.config.component import create_loss
  from pytext.data.utils import Vocabulary
  from pytext.fields import FieldMeta
  from pytext.loss import CrossEntropyLoss, Loss
  from pytext.utils.usage import log_class_usage
  from .output_layer_base import OutputLayerBase
label_desc: Use image node_id 4 for calling the LMOutputLayer obj's underlying member method code with example usage: obj.get_pred(logits) and returns: logits,  None