code: def __init__(
      self,
      num_layers: int,
      hidden_size: int,
      inner_size: int,
      num_attention_heads: int = 1,
      attn_score_dropout: float = 0.0,
      attn_layer_dropout: float = 0.0,
      ffn_dropout: float = 0.0,
      hidden_act: str = "relu",
      pre_ln: bool = False,
      pre_ln_final_layer_norm: bool = True,
  ):
      super().__init__()
  
      if pre_ln and pre_ln_final_layer_norm:
          self.final_layer_norm = nn.LayerNorm(hidden_size, eps=1e-5)
      else:
          self.final_layer_norm = None
  
      layer = TransformerDecoderBlock(
          hidden_size,
          inner_size,
          num_attention_heads,
          attn_score_dropout,
          attn_layer_dropout,
          ffn_dropout,
          hidden_act,
          pre_ln,
      )
      self.layers = nn.ModuleList(
          [copy.deepcopy(layer) for _ in range(num_layers)]
      )
      self.diagonal = 0
  
file_path: NeMo/nemo/collections/nlp/modules/common/transformer/transformer_decoders.py
imports: import copy
  import torch
  import torch.nn
  from nemo.collections.common.parts import form_attention_mask
  from nemo.collections.nlp.modules.common.transformer.transformer_modules import MultiHeadAttention, PositionWiseFF
label_desc: Use image node_id 1 to create a new TransformerDecoder object from inherited base classes: nn with example: obj = TransformerDecoder(num_layers, hidden_size, inner_size, num_attention_heads, attn_score_dropout, attn_layer_dropout, ffn_dropout, hidden_act, pre_ln, pre_ln_final_layer_norm)