class_docstr: The layer to compose the transformer decoder.
  
  Args:
      d_model(int): The input feature's channels.
      nhead(int): the number of head for MHSA.
      dim_feedforward(int): The internal channels of linear layer.
      dropout(int): the dropout probability.
      activation(str): the kind of activation that used.
class_docstr_tok: ["The","layer","to","compose","the","transformer","decoder",".","Args",":","d_model","(","int",")",":","The","input","feature","'s","channels",".","nhead","(","int",")",":","the","number","of","head","for","MHSA",".","dim_feedforward","(","int",")",":","The","internal","channels","of","linear","layer",".","dropout","(","int",")",":","the","dropout","probability",".","activation","(","str",")",":","the","kind","of","activation","that","used","."]
code: def forward(
      self,
      tgt,
      memory,
      tgt_mask=None,
      memory_mask=None,
      tgt_key_padding_mask=None,
      memory_key_padding_mask=None,
      pos=None,
      query_pos=None,
  ):
      if tgt_key_padding_mask or memory_key_padding_mask:
          raise ValueError(
              "The multihead attention does not support key_padding_mask"
          )
  
      q = k = self.with_pos_embed(tgt, query_pos).transpose(
          perm=(1, 0, 2)
      )  # [2, 100, 256]
      tgt = tgt.transpose(perm=(1, 0, 2))
      attn = self.self_attn(
          q, k, value=tgt, attn_mask=tgt_mask
      ).transpose(
          perm=(1, 0, 2)
      )  # [100, 2, 256]
      tgt = tgt.transpose(perm=(1, 0, 2))  # [100, 2, 256]
  
      tgt += self.dropout1(attn)
  
      tgt = self.norm1(tgt)  # [100, 2, 256]
      q = self.with_pos_embed(tgt, query_pos).transpose(perm=(1, 0, 2))
      k = self.with_pos_embed(memory, pos).transpose(perm=(1, 0, 2))
      v = memory.transpose(perm=(1, 0, 2))
      attn = self.multihead_attn(
          query=q, key=k, value=v, attn_mask=memory_mask
      ).transpose(perm=(1, 0, 2))
      tgt += self.dropout2(attn)
      tgt = self.norm2(tgt)  # [100, 2, 256]
      attn = self.linear2(
          self.dropout(self.activation(self.linear1(tgt)))
      )  # [100, 2, 256]
      tgt += self.dropout3(attn)
      tgt = self.norm3(tgt)
      return tgt
  
imports: import math
  import copy
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddleseg.models import layers
  from paddleseg.cvlibs import manager, param_init
  from paddleseg.utils import utils
  from paddleseg.core.train import check_logits_losses
label_desc: Use image node_id 4 for calling the DecoderLayer obj's underlying member method code with example usage: obj.forward(tgt, memory, tgt_mask, memory_mask, tgt_key_padding_mask, memory_key_padding_mask, pos, query_pos) and returns: tgt