def METHOD_NAME(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},
    )