class_docstr: Second phase of decoder layer block
  This layer will take the input from the ecoder and phirst pass decoder.
  papers.nips.cc/paper/6775-deliberation-networks-sequence-generation-beyond-one-pass-decoding.pdf
code: def __init__(
      self,
      args,
      no_encoder_decoder_attn=False,
      add_bias_kv=False,
      add_zero_attn=False,
  ):
      super().__init__()
      self.embed_dim = args.decoder_embed_dim
      self.self_attn = MultiheadAttention(
          embed_dim=self.embed_dim,
          num_heads=args.decoder_attention_heads,
          dropout=args.attention_dropout,
          add_bias_kv=add_bias_kv,
          add_zero_attn=add_zero_attn,
          self_attention=True,
      )
      self.dropout = args.dropout
      self.activation_fn = utils.get_activation_fn(
          activation=getattr(args, "activation_fn", "relu")
      )
      self.activation_dropout = getattr(args, "activation_dropout", 0)
      if self.activation_dropout == 0:
          # for backwards compatibility with models that use args.relu_dropout
          self.activation_dropout = getattr(args, "relu_dropout", 0)
      self.normalize_before = args.decoder_normalize_before
  
      # use layerNorm rather than FusedLayerNorm for exporting.
      # char_inputs can be used to determint this.
      # TODO  remove this once we update apex with the fix
      export = getattr(args, "char_inputs", False)
      self.self_attn_layer_norm = LayerNorm(
          self.embed_dim, export=export
      )
  
      if no_encoder_decoder_attn:
          self.encoder_attn = None
          self.decoder_attn = None
          self.encoder_layer_norm = None
          self.decoder_layer_norm = None
      else:
          self.encoder_attn = MultiheadAttention(
              self.embed_dim,
              args.decoder_attention_heads,
              dropout=args.attention_dropout,
              encoder_decoder_attention=True,
          )
          self.decoder_attn = MultiheadAttention(
              self.embed_dim,
              args.decoder_attention_heads,
              dropout=args.attention_dropout,
              encoder_decoder_attention=True,
          )
          self.encoder_attn_layer_norm = LayerNorm(
              self.embed_dim, export=export
          )
          self.decoder_attn_layer_norm = LayerNorm(
              self.embed_dim, export=export
          )
  
      self.fc1 = Linear(self.embed_dim, args.decoder_ffn_embed_dim)
      self.fc2 = Linear(args.decoder_ffn_embed_dim, self.embed_dim)
  
      self.final_layer_norm = LayerNorm(self.embed_dim, export=export)
      self.need_attn = True
  
      self.onnx_trace = False
  
imports: import math
  import torch
  import torch.nn
  import torch.nn.functional
  from fairseq import options, utils
  from fairseq.models import FairseqEncoderDecoderModel, FairseqIncrementalDecoder, register_model, register_model_architecture
  from fairseq.models.transformer import Embedding, Linear, TransformerDecoder, TransformerEncoder
  from fairseq.modules import AdaptiveSoftmax, LayerNorm, MultiheadAttention, PositionalEmbedding, SinusoidalPositionalEmbedding
label_desc: Use image node_id 1 to create a new TransformerDecoderLayerPhase2 object from inherited base classes: nn with example: obj = TransformerDecoderLayerPhase2(args, no_encoder_decoder_attn, add_bias_kv, add_zero_attn)