class_docstr: Wrap T5 in ParlAI.
class_docstr_tok: ["Wrap","T5","in","ParlAI","."]
docstr: Compute output logits.
docstr_tok: ["Compute","output","logits","."]
code: def output(self, tensor):
      """
      Compute output logits.
      """
      # Taken directly from HuggingFace
      # Rescale output before projecting on vocab
      # See https://github.com/tensorflow/mesh/blob/fa19d69/mesh_tensorflow/transformer/transformer.py#L586
      tensor = tensor * (self.t5.model_dim**-0.5)
      lm_logits = self.t5.lm_head(tensor)
      return lm_logits
  
imports: import torch
  from typing import Optional, Dict, Any, Tuple
  from transformers import T5ForConditionalGeneration
  from parlai.agents.hugging_face.hugging_face import HF_VERSION
  from parlai.agents.hugging_face.dict import T5DictionaryAgent
  from parlai.core.opt import Opt
  from parlai.core.params import ParlaiParser
  from parlai.core.torch_agent import Batch, TorchAgent
  from parlai.core.torch_generator_agent import TorchGeneratorAgent, TorchGeneratorModel
  from parlai.utils.fsdp import is_fsdp, delay_halving
label_desc: Use image node_id 5 for calling the ParlaiT5Model obj's underlying member method code with example usage: obj.output(tensor) and returns: lm_logits