class_docstr: Implements a full generator model, with one encoder and one decoder.
class_docstr_tok: ["Implements","a","full","generator","model",",","with","one","encoder","and","one","decoder","."]
docstr: Compute output logits.
docstr_tok: ["Compute","output","logits","."]
code: def output(self, tensor):
      """
      Compute output logits.
      """
      # project back to vocabulary
      output = F.linear(tensor, self.embeddings.weight)
      # compatibility with fairseq: fairseq sometimes reuses BOS tokens and
      # we need to force their probability of generation to be 0.
      output[:, :, self.start_idx] = neginf(output.dtype)
      return output
  
file_path: ParlAI/parlai/agents/transformer/modules/generator.py
imports: from __future__ import annotations
  from typing import Dict, Type
  import torch
  import torch.cuda
  import torch.nn.functional
  from parlai.agents.transformer.modules import create_embeddings, TransformerDecoder, TransformerEncoder
  from parlai.agents.transformer.modules.modular import swappable
  from parlai.core.opt import Opt
  from parlai.core.torch_agent import DictionaryAgent
  from parlai.core.torch_generator_agent import TorchGeneratorModel
  from parlai.utils.torch import neginf
label_desc: Use image node_id 6 for calling the TransformerGeneratorModel obj's underlying member method code with example usage: obj.output(tensor) and returns: output