class_docstr: __init__(self, n_layers, in_size, out_size, dropout, *, initialW=None, initial_bias=None)
  
  Base link class for Stacked RNN/BiRNN links.
  
  This link is base link class for :func:`chainer.links.NStepRNN` and
  :func:`chainer.links.NStepBiRNN`.
  
  This link's behavior depends on argument, ``use_bi_direction``.
  
  Args:
      n_layers (int): Number of layers.
      in_size (int): Dimensionality of input vectors.
      out_size (int): Dimensionality of hidden states and output vectors.
      dropout (float): Dropout ratio.
      initialW (:ref:`initializer <initializer>`): Initializer to initialize
          the weight. When it is :class:`numpy.ndarray`,
          its ``ndim`` should be 2. If ``initialW`` is ``None``, then the
          weights are initialized with i.i.d. Gaussian samples, each of which
          has zero mean and deviation :math:`\sqrt{1/\text{in_size}}`.
      initial_bias (:ref:`initializer <initializer>`): Initializer to
          initialize the bias. If ``None``, the bias will be initialized to
          zero. When it is :class:`numpy.ndarray`, its ``ndim`` should be 1.
  
  .. seealso::
      :func:`chainer.links.NStepRNNReLU`
      :func:`chainer.links.NStepRNNTanh`
      :func:`chainer.links.NStepBiRNNReLU`
      :func:`chainer.links.NStepBiRNNTanh`
docstr: forward(self, hx, xs)
  
  Calculates all of the hidden states and the cell states.
  
  Args:
      hx (:class:`~chainer.Variable` or None): Initial hidden states.
          If ``None`` is specified zero-vector is used.
          Its shape is ``(S, B, N)`` for uni-directional RNN
          and ``(2S, B, N)`` for bi-directional RNN where ``S`` is
          the number of layers and is equal to ``n_layers``, ``B`` is
          the mini-batch size, and ``N`` is the dimension of
          the hidden units.
      xs (list of :class:`~chainer.Variable`): List of input sequences.
          Each element ``xs[i]`` is a :class:`chainer.Variable` holding
          a sequence. Its shape is ``(L_i, I)``, where ``L_i`` is the
          length of a sequence for batch ``i``, and ``I`` is the size of
          the input and is equal to ``in_size``.
  
  Returns:
      tuple: This function returns a tuple containing two elements,
      ``hy`` and ``ys``.
  
      - ``hy`` is an updated hidden states whose shape is same as ``hx``.
      - ``ys`` is a list of :class:`~chainer.Variable` . Each element
        ``ys[i]`` holds hidden states of the last layer corresponding
        to an input ``xs[i]``. Its shape is ``(L_i, N)`` for
        uni-directional RNN and ``(L_i, 2N)`` for bi-directional RNN
        where ``L_i`` is the length of a sequence for batch ``i``,
        and ``N`` is size of hidden units.
docstr_tok: ["forward","(","self",",","hx",",","xs",")","Calculates","all","of","the","hidden","states","and","the","cell","states",".","Args",":","hx","(",":","class",":","`","~chainer.Variable","`","or","None",")",":","Initial","hidden","states",".","If","``","None","``","is","specified","zero-vector","is","used",".","Its","shape","is","``","(","S",",","B",",","N",")","``","for","uni-directional","RNN","and","``","(","2S",",","B",",","N",")","``","for","bi-directional","RNN","where","``","S","``","is","the","number","of","layers","and","is","equal","to","``","n_layers","``",",","``","B","``","is","the","mini-batch","size",",","and","``","N","``","is","the","dimension","of","the","hidden","units",".","xs","(","list","of",":","class",":","`","~chainer.Variable","`",")",":","List","of","input","sequences",".","Each","element","``","xs","[","i","]","``","is","a",":","class",":","`","chainer.Variable","`","holding","a","sequence",".","Its","shape","is","``","(","L_i",",","I",")","``",",","where","``","L_i","``","is","the","length","of","a","sequence","for","batch","``","i","``",",","and","``","I","``","is","the","size","of","the","input","and","is","equal","to","``","in_size","``",".","Returns",":","tuple",":","This","function","returns","a","tuple","containing","two","elements",",","``","hy","``","and","``","ys","``",".","-","``","hy","``","is","an","updated","hidden","states","whose","shape","is","same","as","``","hx","``",".","-","``","ys","``","is","a","list","of",":","class",":","`","~chainer.Variable","`",".","Each","element","``","ys","[","i","]","``","holds","hidden","states","of","the","last","layer","corresponding","to","an","input","``","xs","[","i","]","``",".","Its","shape","is","``","(","L_i",",","N",")","``","for","uni-directional","RNN","and","``","(","L_i",",","2N",")","``","for","bi-directional","RNN","where","``","L_i","``","is","the","length","of","a","sequence","for","batch","``","i","``",",","and","``","N","``","is","size","of","hidden","units","."]
code: def forward(self, hx, xs, **kwargs):
      """forward(self, hx, xs)
  
      Calculates all of the hidden states and the cell states.
  
      Args:
          hx (:class:`~chainer.Variable` or None): Initial hidden states.
              If ``None`` is specified zero-vector is used.
              Its shape is ``(S, B, N)`` for uni-directional RNN
              and ``(2S, B, N)`` for bi-directional RNN where ``S`` is
              the number of layers and is equal to ``n_layers``, ``B`` is
              the mini-batch size, and ``N`` is the dimension of
              the hidden units.
          xs (list of :class:`~chainer.Variable`): List of input sequences.
              Each element ``xs[i]`` is a :class:`chainer.Variable` holding
              a sequence. Its shape is ``(L_i, I)``, where ``L_i`` is the
              length of a sequence for batch ``i``, and ``I`` is the size of
              the input and is equal to ``in_size``.
  
      Returns:
          tuple: This function returns a tuple containing two elements,
          ``hy`` and ``ys``.
  
          - ``hy`` is an updated hidden states whose shape is same as ``hx``.
          - ``ys`` is a list of :class:`~chainer.Variable` . Each element
            ``ys[i]`` holds hidden states of the last layer corresponding
            to an input ``xs[i]``. Its shape is ``(L_i, N)`` for
            uni-directional RNN and ``(L_i, 2N)`` for bi-directional RNN
            where ``L_i`` is the length of a sequence for batch ``i``,
            and ``N`` is size of hidden units.
      """
      (hy,), ys = self._call([hx], xs, **kwargs)
      return hy, ys
  
imports: import numpy
  import six
  import chainer
  from chainer.functions.array import permutate
  from chainer.functions.array import transpose_sequence
  from chainer.functions.rnn import n_step_rnn
  from chainer import initializers
  from chainer import link
  from chainer.utils import argument
  from chainer import variable
label_desc: Use image node_id 6 for calling the NStepRNNBase obj's underlying member method code with example usage: obj.forward(hx, xs) and returns: hy,  ys