code: def test_basics(self):
      self.run_layer_test(
          layers.RNN,
          init_kwargs={
              "cell": [
                  OneStateRNNCell(3),
                  OneStateRNNCell(4),
                  OneStateRNNCell(5),
              ],
          },
          input_shape=(2, 3, 4),
          expected_output_shape=(2, 5),
          expected_num_trainable_weights=6,
          expected_num_non_trainable_weights=0,
          expected_num_seed_generators=0,
          supports_masking=True,
          custom_objects={"OneStateRNNCell": OneStateRNNCell},
      )
      self.run_layer_test(
          layers.RNN,
          init_kwargs={
              "cell": [
                  OneStateRNNCell(3),
                  OneStateRNNCell(4),
                  OneStateRNNCell(5),
              ],
              "return_sequences": True,
          },
          input_shape=(2, 3, 4),
          expected_output_shape=(2, 3, 5),
          expected_num_trainable_weights=6,
          expected_num_non_trainable_weights=0,
          expected_num_seed_generators=0,
          supports_masking=True,
          custom_objects={"OneStateRNNCell": OneStateRNNCell},
      )
      # Two-state case.
      self.run_layer_test(
          layers.RNN,
          init_kwargs={
              "cell": [
                  TwoStatesRNNCell(3),
                  TwoStatesRNNCell(4),
                  TwoStatesRNNCell(5),
              ],
          },
          input_shape=(2, 3, 4),
          expected_output_shape=(2, 5),
          expected_num_trainable_weights=9,
          expected_num_non_trainable_weights=0,
          expected_num_seed_generators=0,
          supports_masking=True,
          custom_objects={"TwoStatesRNNCell": TwoStatesRNNCell},
      )
      self.run_layer_test(
          layers.RNN,
          init_kwargs={
              "cell": [
                  TwoStatesRNNCell(3),
                  TwoStatesRNNCell(4),
                  TwoStatesRNNCell(5),
              ],
              "return_sequences": True,
          },
          input_shape=(2, 3, 4),
          expected_output_shape=(2, 3, 5),
          expected_num_trainable_weights=9,
          expected_num_non_trainable_weights=0,
          expected_num_seed_generators=0,
          supports_masking=True,
          custom_objects={"TwoStatesRNNCell": TwoStatesRNNCell},
      )
      self.run_layer_test(
          layers.RNN,
          init_kwargs={
              "cell": [
                  layers.SimpleRNNCell(
                      3, dropout=0.1, recurrent_dropout=0.1
                  ),
                  layers.SimpleRNNCell(
                      4, dropout=0.1, recurrent_dropout=0.1
                  ),
                  layers.SimpleRNNCell(
                      5, dropout=0.1, recurrent_dropout=0.1
                  ),
              ],
              "return_sequences": True,
          },
          input_shape=(2, 3, 4),
          expected_output_shape=(2, 3, 5),
          expected_num_trainable_weights=9,
          expected_num_non_trainable_weights=0,
          expected_num_seed_generators=0,
          supports_masking=True,
      )
      self.run_layer_test(
          layers.RNN,
          init_kwargs={
              "cell": [
                  layers.GRUCell(3, dropout=0.1, recurrent_dropout=0.1),
                  layers.GRUCell(4, dropout=0.1, recurrent_dropout=0.1),
                  layers.GRUCell(5, dropout=0.1, recurrent_dropout=0.1),
              ],
              "return_sequences": True,
          },
          input_shape=(2, 3, 4),
          expected_output_shape=(2, 3, 5),
          expected_num_trainable_weights=9,
          expected_num_non_trainable_weights=0,
          expected_num_seed_generators=0,
          supports_masking=True,
      )
      self.run_layer_test(
          layers.RNN,
          init_kwargs={
              "cell": [
                  layers.LSTMCell(
                      3, dropout=0.1, recurrent_dropout=0.1
                  ),
                  layers.LSTMCell(
                      4, dropout=0.1, recurrent_dropout=0.1
                  ),
                  layers.LSTMCell(
                      5, dropout=0.1, recurrent_dropout=0.1
                  ),
              ],
              "return_sequences": True,
          },
          input_shape=(2, 3, 4),
          expected_output_shape=(2, 3, 5),
          expected_num_trainable_weights=9,
          expected_num_non_trainable_weights=0,
          expected_num_seed_generators=0,
          supports_masking=True,
      )
  
file_path: keras/keras/layers/rnn/stacked_rnn_cells_test.py
imports: import numpy
  import pytest
  from keras import layers
  from keras import testing
  from keras.layers.rnn.rnn_test import OneStateRNNCell
  from keras.layers.rnn.rnn_test import TwoStatesRNNCell
label_desc: Use image node_id 1 for calling the StackedRNNTest obj's underlying member method code with example usage: obj.test_basics() without return types