code: def test_basic_simplernn_dynamic_3(self):
      class CustomisedModel(tl.models.Model):
          def __init__(self):
              super(CustomisedModel, self).__init__()
              self.rnnlayer1 = tl.layers.RNN(
                  cell=tf.keras.layers.SimpleRNNCell(
                      units=8, dropout=0.1
                  ),
                  in_channels=4,
                  return_last_output=True,
                  return_last_state=True,
              )
              self.rnnlayer2 = tl.layers.RNN(
                  cell=tf.keras.layers.SimpleRNNCell(
                      units=8, dropout=0.1
                  ),
                  in_channels=4,
                  return_last_output=True,
                  return_last_state=False,
              )
              self.dense = tl.layers.Dense(in_channels=8, n_units=1)
  
          def forward(self, x):
              _, state = self.rnnlayer1(x[:, :2, :])
              z = self.rnnlayer2(x[:, 2:, :], initial_state=state)
              z = self.dense(z)
              return z
  
      rnn_model = CustomisedModel()
      print(rnn_model)
      optimizer = tf.optimizers.Adam(learning_rate=0.01)
      rnn_model.train()
      assert rnn_model.rnnlayer1.is_train
      assert rnn_model.rnnlayer2.is_train
  
      for epoch in range(50):
          with tf.GradientTape() as tape:
              pred_y = rnn_model(self.data_x)
              loss = tl.cost.mean_squared_error(pred_y, self.data_y)
  
          gradients = tape.gradient(loss, rnn_model.trainable_weights)
          optimizer.apply_gradients(
              zip(gradients, rnn_model.trainable_weights)
          )
  
          if (epoch + 1) % 10 == 0:
              print("epoch %d, loss %f" % (epoch, loss))
  
imports: import os
  import unittest
  import numpy
  import tensorflow
  import tensorlayer
  from tests.utils import CustomTestCase
label_desc: Use image node_id 10 for calling the Layer_RNN_Test obj's underlying member method code with example usage: obj.test_basic_simplernn_dynamic_3() and returns: z