class_docstr: Single decoder layer module.
  
  Args:
      size (int): Input dimension.
      self_attn (torch.nn.Module): Self-attention module instance.
          `MultiHeadedAttention` instance can be used as the argument.
      src_attn (torch.nn.Module): Self-attention module instance.
          `MultiHeadedAttention` instance can be used as the argument.
      feed_forward (torch.nn.Module): Feed-forward module instance.
          `PositionwiseFeedForward`, `MultiLayeredConv1d`, or `Conv1dLinear` instance
          can be used as the argument.
      dropout_rate (float): Dropout rate.
      normalize_before (bool): Whether to use layer_norm before the first block.
      concat_after (bool): Whether to concat attention layer's input and output.
          if True, additional linear will be applied.
          i.e. x -> x + linear(concat(x, att(x)))
          if False, no additional linear will be applied. i.e. x -> x + att(x)
      sequential_attn (bool): computes attn first on pre_x then on x,
              thereby attending to two sources in sequence.
docstr: Construct an DecoderLayer object.
docstr_tok: ["Construct","an","DecoderLayer","object","."]
code: def __init__(
      self,
      size,
      self_attn,
      src_attn,
      feed_forward,
      dropout_rate,
      normalize_before=True,
      concat_after=False,
      sequential_attn=None,
  ):
      """Construct an DecoderLayer object."""
      super(DecoderLayer, self).__init__()
      self.size = size
      self.self_attn = self_attn
      self.src_attn = src_attn
      self.feed_forward = feed_forward
      self.sequential_attn = sequential_attn
      self.norm1 = LayerNorm(size)
      self.norm2 = LayerNorm(size)
      self.norm3 = LayerNorm(size)
      if sequential_attn is not None:
          self.norm4 = LayerNorm(size)
      self.dropout = nn.Dropout(dropout_rate)
      self.normalize_before = normalize_before
      self.concat_after = concat_after
      if self.concat_after:
          self.concat_linear1 = nn.Linear(size + size, size)
          self.concat_linear2 = nn.Linear(size + size, size)
          if sequential_attn is not None:
              self.concat_linear3 = nn.Linear(size + size, size)
  
imports: import torch
  from torch import nn
  from espnet.nets.pytorch_backend.transformer.layer_norm import LayerNorm
label_desc: Use image node_id 1 to create a new DecoderLayer object from inherited base classes: nn with example: obj = DecoderLayer(size, _attn, src_attn, feed_forward, dropout_rate, normalize_before, concat_after, sequential_attn)