code: def test_dynamic_rnn_with_seq_len_op2(self):
      data = [
          [[1], [2], [0], [0], [0]],
          [[1], [2], [3], [0], [0]],
          [[1], [2], [6], [1], [1]],
      ]
      data = tf.convert_to_tensor(data, dtype=tf.float32)
  
      class DynamicRNNExample(tl.models.Model):
          def __init__(self):
              super(DynamicRNNExample, self).__init__()
  
              self.rnnlayer = tl.layers.RNN(
                  cell=tf.keras.layers.SimpleRNNCell(
                      units=6, dropout=0.1
                  ),
                  in_channels=1,
                  return_last_output=True,
                  return_last_state=True,
              )
  
          def forward(self, x):
              z0, s0 = self.rnnlayer(x, sequence_length=None)
              z1, s1 = self.rnnlayer(
                  x,
                  sequence_length=tl.layers.retrieve_seq_length_op3(x),
              )
              z2, s2 = self.rnnlayer(
                  x,
                  sequence_length=tl.layers.retrieve_seq_length_op3(x),
                  initial_state=s1,
              )
              print(z0)
              print(z1)
              print(z2)
              print("===")
              print(s0)
              print(s1)
              print(s2)
              return z2, s2
  
      model = DynamicRNNExample()
      model.eval()
  
      output, state = model(data)
      print(output.shape)
      print(state)
  
imports: import os
  import unittest
  import numpy
  import tensorflow
  import tensorlayer
  from tests.utils import CustomTestCase
label_desc: Use image node_id 29 for calling the Layer_RNN_Test obj's underlying member method code with example usage: obj.test_dynamic_rnn_with_seq_len_op2() and returns: z2,  s2