class_docstr: Stateless LSTM layer.
  
  This is a fully-connected LSTM layer as a chain. Unlike the
  :func:`~chainer.functions.lstm` function, this chain holds upward and
  lateral connections as child links. This link doesn't keep cell and
  hidden states.
  
  Args:
      in_size (int or None): Dimension of input vectors. If ``None``,
          parameter initialization will be deferred until the first forward
          data pass at which time the size will be determined.
      out_size (int): Dimensionality of output vectors.
  
  Attributes:
      upward (chainer.links.Linear): Linear layer of upward connections.
      lateral (chainer.links.Linear): Linear layer of lateral connections.
  
  .. admonition:: Example
  
      There are several ways to make a StatelessLSTM link.
  
      Let a two-dimensional input array :math:`x`, a cell state array
      :math:`h`, and the output array of the previous step :math:`h` be:
  
      >>> x = np.zeros((1, 10), dtype=np.float32)
      >>> c = np.zeros((1, 20), dtype=np.float32)
      >>> h = np.zeros((1, 20), dtype=np.float32)
  
      1. Give both ``in_size`` and ``out_size`` arguments:
  
          >>> l = L.StatelessLSTM(10, 20)
          >>> c_new, h_new = l(c, h, x)
          >>> c_new.shape
          (1, 20)
          >>> h_new.shape
          (1, 20)
  
      2. Omit ``in_size`` argument or fill it with ``None``:
  
          The below two cases are the same.
  
          >>> l = L.StatelessLSTM(20)
          >>> c_new, h_new = l(c, h, x)
          >>> c_new.shape
          (1, 20)
          >>> h_new.shape
          (1, 20)
  
          >>> l = L.StatelessLSTM(None, 20)
          >>> c_new, h_new = l(c, h, x)
          >>> c_new.shape
          (1, 20)
          >>> h_new.shape
          (1, 20)
class_docstr_tok: ["Stateless","LSTM","layer",".","This","is","a","fully-connected","LSTM","layer","as","a","chain",".","Unlike","the",":","func",":","`","~chainer.functions.lstm","`","function",",","this","chain","holds","upward","and","lateral","connections","as","child","links",".","This","link","does","n't","keep","cell","and","hidden","states",".","Args",":","in_size","(","int","or","None",")",":","Dimension","of","input","vectors",".","If","``","None","``",",","parameter","initialization","will","be","deferred","until","the","first","forward","data","pass","at","which","time","the","size","will","be","determined",".","out_size","(","int",")",":","Dimensionality","of","output","vectors",".","Attributes",":","upward","(","chainer.links.Linear",")",":","Linear","layer","of","upward","connections",".","lateral","(","chainer.links.Linear",")",":","Linear","layer","of","lateral","connections",".","..","admonition",":",":","Example","There","are","several","ways","to","make","a","StatelessLSTM","link",".","Let","a","two-dimensional","input","array",":","math",":","`","x","`",",","a","cell","state","array",":","math",":","`","h","`",",","and","the","output","array","of","the","previous","step",":","math",":","`","h","`","be",":",">",">",">","x","=","np.zeros","(","(","1",",","10",")",",","dtype=np.float32",")",">",">",">","c","=","np.zeros","(","(","1",",","20",")",",","dtype=np.float32",")",">",">",">","h","=","np.zeros","(","(","1",",","20",")",",","dtype=np.float32",")","1",".","Give","both","``","in_size","``","and","``","out_size","``","arguments",":",">",">",">","l","=","L.StatelessLSTM","(","10",",","20",")",">",">",">","c_new",",","h_new","=","l","(","c",",","h",",","x",")",">",">",">","c_new.shape","(","1",",","20",")",">",">",">","h_new.shape","(","1",",","20",")","2",".","Omit","``","in_size","``","argument","or","fill","it","with","``","None","``",":","The","below","two","cases","are","the","same",".",">",">",">","l","=","L.StatelessLSTM","(","20",")",">",">",">","c_new",",","h_new","=","l","(","c",",","h",",","x",")",">",">",">","c_new.shape","(","1",",","20",")",">",">",">","h_new.shape","(","1",",","20",")",">",">",">","l","=","L.StatelessLSTM","(","None",",","20",")",">",">",">","c_new",",","h_new","=","l","(","c",",","h",",","x",")",">",">",">","c_new.shape","(","1",",","20",")",">",">",">","h_new.shape","(","1",",","20",")"]
docstr: Returns new cell state and updated output of LSTM.
  
  Args:
      c (~chainer.Variable): Cell states of LSTM units.
      h (~chainer.Variable): Output at the previous time step.
      x (~chainer.Variable): A new batch from the input sequence.
  
  Returns:
      tuple of ~chainer.Variable: Returns ``(c_new, h_new)``, where
      ``c_new`` represents new cell state, and ``h_new`` is updated
      output of LSTM units.
docstr_tok: ["Returns","new","cell","state","and","updated","output","of","LSTM",".","Args",":","c","(","~chainer.Variable",")",":","Cell","states","of","LSTM","units",".","h","(","~chainer.Variable",")",":","Output","at","the","previous","time","step",".","x","(","~chainer.Variable",")",":","A","new","batch","from","the","input","sequence",".","Returns",":","tuple","of","~chainer.Variable",":","Returns","``","(","c_new",",","h_new",")","``",",","where","``","c_new","``","represents","new","cell","state",",","and","``","h_new","``","is","updated","output","of","LSTM","units","."]
code: def forward(self, c, h, x):
      """Returns new cell state and updated output of LSTM.
  
      Args:
          c (~chainer.Variable): Cell states of LSTM units.
          h (~chainer.Variable): Output at the previous time step.
          x (~chainer.Variable): A new batch from the input sequence.
  
      Returns:
          tuple of ~chainer.Variable: Returns ``(c_new, h_new)``, where
          ``c_new`` represents new cell state, and ``h_new`` is updated
          output of LSTM units.
  
      """
      if self.upward.W.array is None:
          in_size = x.size // x.shape[0]
          with chainer.using_device(self.device):
              self.upward._initialize_params(in_size)
              self._initialize_params()
  
      lstm_in = self.upward(x)
      if h is not None:
          lstm_in += self.lateral(h)
      if c is None:
          xp = self.xp
          with chainer.using_device(self.device):
              c = variable.Variable(
                  xp.zeros((x.shape[0], self.state_size), dtype=x.dtype)
              )
      return lstm.lstm(c, lstm_in)
  
imports: import six
  import chainer
  from chainer.functions.array import concat
  from chainer.functions.array import split_axis
  from chainer.functions.rnn import lstm
  from chainer import initializers
  from chainer import link
  from chainer.links.connection import linear
  from chainer import utils
  from chainer import variable
label_desc: Use image node_id 1 for calling the StatelessLSTM obj's underlying member method code with example usage: obj.forward(c, h, x) and returns: lstm