docstr: Parameters
  ----------
  data
      - layout = 'NT'
          Shape (batch_size, query_length)
      - layout = 'TN'
          Shape (query_length, batch_size)
  
  mem_l
      Contains a list of memory objects, each one will contain:
  
      - layout = 'NT'
          Shape (batch_size, mem_length, C_i)
      - layout = 'TN'
          Shape (mem_length, batch_size, C_i)
  
  rel_positions
      The relative positions.
      Shape (query_length, mem_length + query_length)
  mask
      Mask between the query and the memory + query.
      Shape (batch_size, query_length, mem_length + query_length)
  
  Returns
  -------
  out_l
      Contains a list of hidden states, each will contain:
  
      - layout = 'NT'
          Shape (batch_size, query_length, C_o)
      - layout = 'TN'
          Shape (query_length, batch_size, C_o)
docstr_tok: ["Parameters","--","--","--","--","--","data","-","layout","=","'NT'","Shape","(","batch_size",",","query_length",")","-","layout","=","'TN'","Shape","(","query_length",",","batch_size",")","mem_l","Contains","a","list","of","memory","objects",",","each","one","will","contain",":","-","layout","=","'NT'","Shape","(","batch_size",",","mem_length",",","C_i",")","-","layout","=","'TN'","Shape","(","mem_length",",","batch_size",",","C_i",")","rel_positions","The","relative","positions",".","Shape","(","query_length",",","mem_length","+","query_length",")","mask","Mask","between","the","query","and","the","memory","+","query",".","Shape","(","batch_size",",","query_length",",","mem_length","+","query_length",")","Returns","--","--","--","-","out_l","Contains","a","list","of","hidden","states",",","each","will","contain",":","-","layout","=","'NT'","Shape","(","batch_size",",","query_length",",","C_o",")","-","layout","=","'TN'","Shape","(","query_length",",","batch_size",",","C_o",")"]
code: def forward(self, data, mem_l, rel_positions, mask):
      """
  
      Parameters
      ----------
      data
          - layout = 'NT'
              Shape (batch_size, query_length)
          - layout = 'TN'
              Shape (query_length, batch_size)
  
      mem_l
          Contains a list of memory objects, each one will contain:
  
          - layout = 'NT'
              Shape (batch_size, mem_length, C_i)
          - layout = 'TN'
              Shape (mem_length, batch_size, C_i)
  
      rel_positions
          The relative positions.
          Shape (query_length, mem_length + query_length)
      mask
          Mask between the query and the memory + query.
          Shape (batch_size, query_length, mem_length + query_length)
  
      Returns
      -------
      out_l
          Contains a list of hidden states, each will contain:
  
          - layout = 'NT'
              Shape (batch_size, query_length, C_o)
          - layout = 'TN'
              Shape (query_length, batch_size, C_o)
  
      """
      query_k_bias = self.query_k_bias.data()
      query_r_bias = self.query_r_bias.data()
      out_l = []
      out = data
      for i, layer in enumerate(self.decoder_layers):
          out = layer(
              out,
              mem_l[i],
              rel_positions,
              mask,
              query_r_bias,
              query_k_bias,
          )
          out_l.append(out)
      return out_l
  
imports: import numpy
  import mxnet
  from mxnet import use_np, np, npx
  from mxnet.gluon import nn, Block, HybridBlock, Parameter
  from ..attention_cell import multi_head_dot_attn, gen_self_attn_mask, gen_mem_attn_mask, RelAttentionScoreCell, MultiHeadAttentionCell
  from ..layers import get_activation, PositionalEmbedding, PositionwiseFFN, AdaptiveEmbedding, ProjectedAdaptiveLogSoftmaxWithLoss
  from ..utils.config import CfgNode
  from ..sequence_sampler import BaseStepDecoder
label_desc: Use image node_id 2 for calling the TransformerXLDecoder obj's underlying member method code with example usage: obj.forward(data, mem_l, rel_positions, mask) and returns: out_l