class_docstr: Transformer decoder consisting of *cfg.decoder.layers* layers. Each layer
  is a :class:`TransformerDecoderLayer`.
  
  Args:
      cfg (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).
class_docstr_tok: ["Transformer","decoder","consisting","of","*","cfg.decoder.layers","*","layers",".","Each","layer","is","a",":","class",":","`","TransformerDecoderLayer","`",".","Args",":","cfg","(","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",")","."]
code: def build_output_projection(self, cfg, dictionary, embed_tokens):
      if cfg.adaptive_softmax_cutoff is not None:
          self.adaptive_softmax = AdaptiveSoftmax(
              len(dictionary),
              self.output_embed_dim,
              utils.eval_str_list(
                  cfg.adaptive_softmax_cutoff, type=int
              ),
              dropout=cfg.adaptive_softmax_dropout,
              adaptive_inputs=embed_tokens
              if cfg.tie_adaptive_weights
              else None,
              factor=cfg.adaptive_softmax_factor,
              tie_proj=cfg.tie_adaptive_proj,
          )
      elif self.share_input_output_embed:
          self.output_projection = nn.Linear(
              self.embed_tokens.weight.shape[1],
              self.embed_tokens.weight.shape[0],
              bias=False,
          )
          self.output_projection.weight = self.embed_tokens.weight
      else:
          self.output_projection = nn.Linear(
              self.output_embed_dim, len(dictionary), bias=False
          )
          nn.init.normal_(
              self.output_projection.weight,
              mean=0,
              std=self.output_embed_dim**-0.5,
          )
      num_base_layers = cfg.base_layers
      for i in range(num_base_layers):
          self.layers.insert(
              ((i + 1) * cfg.decoder.layers) // (num_base_layers + 1),
              BaseLayer(cfg),
          )
  
imports: import math
  from typing import Any, Dict, List, Optional
  import torch
  import torch.nn
  from torch import Tensor
  from fairseq import utils
  from fairseq.distributed import fsdp_wrap
  from fairseq.models import FairseqIncrementalDecoder
  from fairseq.models.transformer import TransformerConfig
  from fairseq.modules import AdaptiveSoftmax, BaseLayer, FairseqDropout, LayerDropModuleList, LayerNorm, PositionalEmbedding, SinusoidalPositionalEmbedding, transformer_layer
  from fairseq.modules.checkpoint_activations import checkpoint_wrapper
  from fairseq.modules.quant_noise import quant_noise
label_desc: Use image node_id 2 for calling the TransformerDecoderBase obj's underlying member method code with example usage: obj.build_output_projection(cfg, dictionary, embed_tokens) without return types