code: def testLSTMCell(self):
      # Run with all-0 weights, no padding.
      m, c = self._RunLSTMCell(
          "zeros", init_ops.zeros_initializer(), 0.0, 0.0, 0.0
      )
      self.assertAllClose(m, [[0.0]] * self._batch_size)
      self.assertAllClose(c, [[0.0]] * self._batch_size)
      m, c = self._RunLSTMCell(
          "zeros", init_ops.zeros_initializer(), 0.0, 1.0, 0.0
      )
      self.assertAllClose(m, [[0.25]] * self._batch_size)
      self.assertAllClose(c, [[0.5]] * self._batch_size)
      m, c = self._RunLSTMCell(
          "zeros", init_ops.zeros_initializer(), 1.0, 0.0, 0.0
      )
      self.assertAllClose(m, [[0.0]] * self._batch_size)
      self.assertAllClose(c, [[0.0]] * self._batch_size)
      m, c = self._RunLSTMCell(
          "zeros", init_ops.zeros_initializer(), 1.0, 1.0, 0.0
      )
      self.assertAllClose(m, [[0.25]] * self._batch_size)
      self.assertAllClose(c, [[0.5]] * self._batch_size)
  
      # Run with all-1 weights, no padding.
      for m_prev in [0.0, 1.0]:
          for c_prev in [0.0, 1.0]:
              m, c = self._RunLSTMCell(
                  "ones",
                  init_ops.ones_initializer(),
                  m_prev,
                  c_prev,
                  0.0,
              )
              self.assertAllClose(
                  m, self._NextM(self._inputs, 1.0, m_prev, c_prev)
              )
              self.assertAllClose(
                  c, self._NextC(self._inputs, 1.0, m_prev, c_prev)
              )
  
      # Run with random weights.
      for weight in np.random.rand(3):
          weight_tf = constant_op.constant(weight, dtypes.float32)
          random_weight = lambda shape, w=weight_tf: array_ops.fill(
              shape, w
          )
  
          # No padding.
          for m_prev in [0.0, 1.0]:
              for c_prev in [0.0, 1.0]:
                  m, c = self._RunLSTMCell(
                      "random", random_weight, m_prev, c_prev, 0.0
                  )
                  self.assertAllClose(
                      m,
                      self._NextM(self._inputs, weight, m_prev, c_prev),
                  )
                  self.assertAllClose(
                      c,
                      self._NextC(self._inputs, weight, m_prev, c_prev),
                  )
  
          # Set padding.
          for m_prev in [0.0, 1.0]:
              for c_prev in [0.0, 1.0]:
                  m, c = self._RunLSTMCell(
                      "random", random_weight, m_prev, c_prev, 1.0
                  )
                  self.assertAllClose(m, [[m_prev]] * self._batch_size)
                  self.assertAllClose(c, [[c_prev]] * self._batch_size)
  
imports: import argparse
  import os
  import sys
  import numpy
  from tensorflow.compiler.tests import lstm
  from tensorflow.compiler.tests import xla_test
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import gradients_impl
  from tensorflow.python.ops import init_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import variables
  from tensorflow.python.platform import test
label_desc: Use image node_id 5 for calling the LSTMTest obj's underlying member method code with example usage: obj.testLSTMCell() without return types