class_docstr: Transformer decoder consisting of *args.decoder_layers* layers. Each layer
  is a :class:`TransformerDecoderLayer`.
  Args:
      args (argparse.Namespace): parsed command-line arguments
      dictionary (~fairseq.data.Dictionary): decoding dictionary
      embed_tokens (torch.nn.Embedding): output embedding
      no_encoder_attn (bool, optional): whether to attend to encoder outputs.
          Default: ``False``
      left_pad (bool, optional): whether the input is left-padded. Default:
          ``False``
class_docstr_tok: ["Transformer","decoder","consisting","of","*","args.decoder_layers","*","layers",".","Each","layer","is","a",":","class",":","`","TransformerDecoderLayer","`",".","Args",":","args","(","argparse.Namespace",")",":","parsed","command-line","arguments","dictionary","(","~fairseq.data.Dictionary",")",":","decoding","dictionary","embed_tokens","(","torch.nn.Embedding",")",":","output","embedding","no_encoder_attn","(","bool",",","optional",")",":","whether","to","attend","to","encoder","outputs",".","Default",":","``","False","``","left_pad","(","bool",",","optional",")",":","whether","the","input","is","left-padded",".","Default",":","``","False","``"]
code: def __init__(
      self,
      dictionary,
      embed_dim=512,
      transformer_config=DEFAULT_ENC_TRANSFORMER_CONFIG,
      conv_config=DEFAULT_DEC_CONV_CONFIG,
      encoder_output_dim=512,
  ):
      super().__init__(dictionary)
      vocab_size = len(dictionary)
      self.padding_idx = dictionary.pad()
      self.embed_tokens = Embedding(
          vocab_size, embed_dim, self.padding_idx
      )
  
      self.conv_layers = nn.ModuleList()
      for i in range(len(conv_config)):
          out_channels, kernel_size, layer_norm = conv_config[i]
          if i == 0:
              conv_layer = LinearizedConv1d(
                  embed_dim,
                  out_channels,
                  kernel_size,
                  padding=kernel_size - 1,
              )
          else:
              conv_layer = LinearizedConv1d(
                  conv_config[i - 1][0],
                  out_channels,
                  kernel_size,
                  padding=kernel_size - 1,
              )
          self.conv_layers.append(conv_layer)
          if layer_norm:
              self.conv_layers.append(nn.LayerNorm(out_channels))
          self.conv_layers.append(nn.ReLU())
  
      self.layers = nn.ModuleList()
      if conv_config[-1][0] != transformer_config[0][0]:
          self.layers.append(
              Linear(conv_config[-1][0], transformer_config[0][0])
          )
      self.layers.append(
          TransformerDecoderLayer(
              prepare_transformer_decoder_params(*transformer_config[0])
          )
      )
  
      for i in range(1, len(transformer_config)):
          if transformer_config[i - 1][0] != transformer_config[i][0]:
              self.layers.append(
                  Linear(
                      transformer_config[i - 1][0],
                      transformer_config[i][0],
                  )
              )
          self.layers.append(
              TransformerDecoderLayer(
                  prepare_transformer_decoder_params(
                      *transformer_config[i]
                  )
              )
          )
      self.fc_out = Linear(transformer_config[-1][0], vocab_size)
  
imports: import argparse
  import math
  from collections.abc import Iterable
  import torch
  import torch.nn
  from examples.speech_recognition.data.data_utils import lengths_to_encoder_padding_mask
  from fairseq import utils
  from fairseq.models import FairseqEncoder, FairseqEncoderDecoderModel, FairseqEncoderModel, FairseqIncrementalDecoder, register_model, register_model_architecture
  from fairseq.modules import LinearizedConvolution, TransformerDecoderLayer, TransformerEncoderLayer, VGGBlock
label_desc: Use image node_id 1 to create a new TransformerDecoder object from inherited base classes: FairseqIncrementalDecoder with example: obj = TransformerDecoder(dictionary, embed_dim, transformer_config, conv_config, encoder_output_dim)