class_docstr: Base link class for Stacked LSTM/BiLSTM links.
  
  This link is base link class for :func:`chainer.links.NStepLSTM` and
  :func:`chainer.links.NStepBiLSTM`.
  
  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.
      use_bi_direction (bool): if ``True``, use Bi-directional LSTM.
  
  .. seealso::
      :func:`chainer.functions.n_step_lstm`
      :func:`chainer.functions.n_step_bilstm`
class_docstr_tok: ["Base","link","class","for","Stacked","LSTM\/BiLSTM","links",".","This","link","is","base","link","class","for",":","func",":","`","chainer.links.NStepLSTM","`","and",":","func",":","`","chainer.links.NStepBiLSTM","`",".","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",".","use_bi_direction","(","bool",")",":","if","``","True","``",",","use","Bi-directional","LSTM",".","..","seealso",":",":",":","func",":","`","chainer.functions.n_step_lstm","`",":","func",":","`","chainer.functions.n_step_bilstm","`"]
docstr: forward(self, hx, cx, 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 LSTM
          and ``(2S, B, N)`` for bi-directional LSTM 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.
      cx (:class:`~chainer.Variable` or None):
          Initial cell states. If ``None`` is specified zero-vector is
          used.  It has the same shape as ``hx``.
      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 three elements,
      ``hy``, ``cy`` and ``ys``.
  
      - ``hy`` is an updated hidden states whose shape is the same as
        ``hx``.
      - ``cy`` is an updated cell states whose shape is the same as
        ``cx``.
      - ``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 LSTM and ``(L_i, 2N)`` for bi-directional LSTM
        where ``L_i`` is the length of a sequence for batch ``i``,
        and ``N`` is size of hidden units.
docstr_tok: ["forward","(","self",",","hx",",","cx",",","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","LSTM","and","``","(","2S",",","B",",","N",")","``","for","bi-directional","LSTM","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",".","cx","(",":","class",":","`","~chainer.Variable","`","or","None",")",":","Initial","cell","states",".","If","``","None","``","is","specified","zero-vector","is","used",".","It","has","the","same","shape","as","``","hx","``",".","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","three","elements",",","``","hy","``",",","``","cy","``","and","``","ys","``",".","-","``","hy","``","is","an","updated","hidden","states","whose","shape","is","the","same","as","``","hx","``",".","-","``","cy","``","is","an","updated","cell","states","whose","shape","is","the","same","as","``","cx","``",".","-","``","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","LSTM","and","``","(","L_i",",","2N",")","``","for","bi-directional","LSTM","where","``","L_i","``","is","the","length","of","a","sequence","for","batch","``","i","``",",","and","``","N","``","is","size","of","hidden","units","."]
code: def forward(self, hx, cx, xs, **kwargs):
      """forward(self, hx, cx, 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 LSTM
              and ``(2S, B, N)`` for bi-directional LSTM 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.
          cx (:class:`~chainer.Variable` or None):
              Initial cell states. If ``None`` is specified zero-vector is
              used.  It has the same shape as ``hx``.
          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 three elements,
          ``hy``, ``cy`` and ``ys``.
  
          - ``hy`` is an updated hidden states whose shape is the same as
            ``hx``.
          - ``cy`` is an updated cell states whose shape is the same as
            ``cx``.
          - ``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 LSTM and ``(L_i, 2N)`` for bi-directional LSTM
            where ``L_i`` is the length of a sequence for batch ``i``,
            and ``N`` is size of hidden units.
      """
      (hy, cy), ys = self._call([hx, cx], xs, **kwargs)
      return hy, cy, ys
  
file_path: chainer/chainer/links/rnn/n_step_lstm.py
imports: from chainer.functions.rnn import n_step_lstm
  from chainer.links.rnn import n_step_rnn
label_desc: Use image node_id 1 for calling the NStepLSTMBase obj's underlying member method code with example usage: obj.forward(hx, cx, xs) and returns: hy,  cy,  ys