code: def _create_fixed_length_lstm(
      xs0, h0, c0, w0, w, b, num_layers, num_directions, with_bias
  ):
      """NStepGRUCells over time and over layers.
      Args:
          xs0 (:obj:`~nnabla.Variable`): Input data with [T, B, I]  shape.
          h0 (:obj:`~nnabla.Variable`): Short-term states with [L, D, B, H] shape.
          c0 (:obj:`~nnabla.Variable`): Long-term states with [L, D, B, H] shape.
          w0 (:obj:`~nnabla.Variable`): Weights at the first layer with [D, 4, H, I+H] shape.
          w (:obj:`~nnabla.Variable`): Weights with [L-1, D, 4, H, D * H + H] shape at layers other than the first layer.
          b (:obj:`~nnabla.Variable`): Biases with [L, D, 4*H] shape.
          num_layers (int): Number of layers.
          num_directions (int): "tanh" or "relu".
          with_bias (bool): Include the bias or not.
      """
      # xs : [T, B, I]
      # h0 : [L, D, B, H]
      # c0 : [L, D, B, H]
      # w0 : [D, 4, H, I+H]
      # w : [L-1, D, 4, H, D * H + H]
      # b : [L, D, 4*H]
  
      batch_size = xs0.shape[1]
      hidden_size = h0.shape[3]
  
      if xs0.shape[0] == 1:
          xs = [xs0[0]]
      else:
          xs = F.split(xs0, axis=0)
      hn = []
      cn = []
      for i in range(num_layers):
          wi = w0
          if i > 0:
              wi = w[i - 1]
          # wi : [D, 4, H, ?]
          # Forward direction
          hif = h0[i, 0]  # [B, H]
          cif = c0[i, 0]  # [B, H]
          wif = wi[0]
          bif = None
          if with_bias:
              bif = b[i, 0]
          hs = []
          for j, x in enumerate(xs):
              # x : [B, I]
              hif, cif = _lstm(x, hif, cif, wif, bif, with_bias)
              hs.append(hif)
          hn.append(hif)
          cn.append(cif)
  
          if num_directions == 1:
              xs = hs
              continue
  
          # Backward direction
          hib = h0[i, 1]  # [B, H]
          cib = c0[i, 1]  # [B, H]
          wib = wi[1]
          bib = None
          if with_bias:
              bib = b[i, 1]
          for (
              k,
              x,
          ) in enumerate(reversed(xs)):
              j = len(xs) - 1 - k
              # x : [B, I]
              hib, cib = _lstm(x, hib, cib, wib, bib, with_bias)
              hs[j] = F.concatenate(hs[j], hib, axis=1)
          hn.append(hib)
          cn.append(cib)
          xs = hs
  
      ys = xs  # list of [B, HD]
      ys = F.stack(*ys, axis=0)  # [T, B, HD]
      hn = F.reshape(
          F.stack(*hn, axis=0),
          (num_layers, num_directions, batch_size, hidden_size),
      )  # LD list of [B, H] --> [L, D, B, H]
      cn = F.reshape(
          F.stack(*cn, axis=0),
          (num_layers, num_directions, batch_size, hidden_size),
      )  # LD list of [B, H] --> [L, D, B, H]
      return ys, hn, cn
  
file_path: nnabla/python/src/nnabla/utils/rnn.py
imports: import nnabla
  import nnabla.functions
  import numpy
label_desc: Use image node_id 10 for calling a global function with example usage: _create_fixed_length_lstm(xs0, h0, c0, w0, w, b, num_layers, num_directions, with_bias) and returns: ys,  hn,  cn