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","."]
code: def build_decoder(
      cls,
      opt,
      embedding=None,
      decoder_class: Type[TransformerDecoder] = TransformerDecoder,
      **kwargs,
  ) -> TransformerDecoder:
      return decoder_class(opt=opt, embedding=embedding, **kwargs)
  
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 2 for calling the TransformerGeneratorModel obj's underlying member method code with example usage: obj.build_decoder(cls, opt, embedding, decoder_class) and returns: decoder_class