docstr: Initialize the states
  
  Parameters
  ----------
  batch_size
  ctx
      ctx of the initialized
  
  Returns
  -------
  mems
      A list of memory states
  
      - layout = 'NT'
          Shape (B, T, C)
      - layout = 'TN'
          Shape (T, B, C)
docstr_tok: ["Initialize","the","states","Parameters","--","--","--","--","--","batch_size","ctx","ctx","of","the","initialized","Returns","--","--","--","-","mems","A","list","of","memory","states","-","layout","=","'NT'","Shape","(","B",",","T",",","C",")","-","layout","=","'TN'","Shape","(","T",",","B",",","C",")"]
code: def init_states(self, batch_size, ctx):
      """Initialize the states
  
      Parameters
      ----------
      batch_size
      ctx
          ctx of the initialized
  
      Returns
      -------
      mems
          A list of memory states
  
          - layout = 'NT'
              Shape (B, T, C)
          - layout = 'TN'
              Shape (T, B, C)
  
      """
      if self._layout == "NT":
          return [
              mx.np.zeros((batch_size, 0, self._units), ctx=ctx)
              for _ in range(self._num_layers)
          ]
      elif self._layout == "TN":
          return [
              mx.np.zeros((0, batch_size, self._units), ctx=ctx)
              for _ in range(self._num_layers)
          ]
      else:
          raise NotImplementedError
  
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 7 for calling the TransformerXLForLM obj's underlying member method code with example usage: obj.init_states(batch_size, ctx) and returns: unknown, unknown