code: def test_statefulness(self):
      sequence = np.arange(24).reshape((2, 3, 4)).astype("float32")
      layer = layers.LSTM(
          4,
          stateful=True,
          kernel_initializer=initializers.Constant(0.01),
          recurrent_initializer=initializers.Constant(0.02),
          bias_initializer=initializers.Constant(0.03),
      )
      layer(sequence)
      output = layer(sequence)
      self.assertAllClose(
          np.array(
              [
                  [0.3124785, 0.3124785, 0.3124785, 0.3124785],
                  [0.6863672, 0.6863672, 0.6863672, 0.6863672],
              ]
          ),
          output,
      )
      layer.reset_state()
      layer(sequence)
      output = layer(sequence)
      self.assertAllClose(
          np.array(
              [
                  [0.3124785, 0.3124785, 0.3124785, 0.3124785],
                  [0.6863672, 0.6863672, 0.6863672, 0.6863672],
              ]
          ),
          output,
      )
  
file_path: keras/keras/layers/rnn/lstm_test.py
imports: import numpy
  import pytest
  from absl.testing import parameterized
  from keras import initializers
  from keras import layers
  from keras import testing
label_desc: Use image node_id 3 for calling the LSTMTest obj's underlying member method code with example usage: obj.test_statefulness() without return types