class_docstr: Long short-term memory unit with forget gate.
  
  It has two inputs (c, x) and two outputs (c, h), where c indicates the cell
  state. x must have four times channels compared to the number of units.
class_docstr_tok: ["Long","short-term","memory","unit","with","forget","gate",".","It","has","two","inputs","(","c",",","x",")","and","two","outputs","(","c",",","h",")",",","where","c","indicates","the","cell","state",".","x","must","have","four","times","channels","compared","to","the","number","of","units","."]
code: def forward(self, inputs):
      self.retain_inputs((0, 1))
      c_prev, x = inputs
      a, i, f, o = _extract_gates(x)
      batch = len(x)
  
      if isinstance(x, chainer.get_cpu_array_types()):
          if intel64.should_use_ideep(">=auto"):
              xp = intel64.ideep.get_array_module(x)
          else:
              xp = numpy
          a = xp.tanh(a)
          i = _sigmoid(i, xp)
          f = _sigmoid(f, xp)
          o = _sigmoid(o, xp)
  
          c_next = numpy.empty_like(c_prev)
          c_next[:batch] = a * i + f * c_prev[:batch]
          h = o * xp.tanh(c_next[:batch])
      else:
          c_next = cuda.cupy.empty_like(c_prev)
          h = cuda.cupy.empty_like(c_next[:batch])
          cuda.elementwise(
              "T c_prev, T a, T i_, T f, T o",
              "T c, T h",
              """
                      COMMON_ROUTINE;
                      c = aa * ai + af * c_prev;
                      h = ao * tanh(c);
                  """,
              "lstm_fwd",
              preamble=_preamble,
          )(c_prev[:batch], a, i, f, o, c_next[:batch], h)
  
      c_next[batch:] = c_prev[batch:]
      self.retain_outputs((0,))
      return c_next, h
  
imports: import numpy
  import six
  import chainer
  from chainer import backend
  from chainer.backends import cuda
  from chainer.backends import intel64
  from chainer import function
  from chainer import function_node
  from chainer.utils import type_check
  import chainerx
label_desc: Use image node_id 3 for calling the LSTM obj's underlying member method code with example usage: obj.forward(inputs) and returns: c_next,  h