code: def forward(
      self,
      tgt,
      memory,
      tgt_mask=None,
      memory_mask=None,
      pos_embed=None,
      query_pos_embed=None,
  ):
      tgt_mask = _convert_attention_mask(tgt_mask, tgt.dtype)
  
      output = tgt
      intermediate = []
      for layer in self.layers:
          output = layer(
              output,
              memory,
              tgt_mask=tgt_mask,
              memory_mask=memory_mask,
              pos_embed=pos_embed,
              query_pos_embed=query_pos_embed,
          )
          if self.return_intermediate:
              intermediate.append(self.norm(output))
  
      if self.norm is not None:
          output = self.norm(output)
  
      if self.return_intermediate:
          return paddle.stack(intermediate)
  
      return output.unsqueeze(0)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from ppdet.core.workspace import register
  from ..layers import MultiHeadAttention, _convert_attention_mask
  from .position_encoding import PositionEmbedding
  from .utils import _get_clones
  from ..initializer import linear_init_, conv_init_, xavier_uniform_, normal_
label_desc: Use image node_id 2 for calling the TransformerDecoder obj's underlying member method code with example usage: obj.forward(tgt, memory, tgt_mask, memory_mask, pos_embed, query_pos_embed) and returns: output, paddle