code: def testMixOfNonRecurrentAndRecurrent(self):
      sequential = sequential_lib.Sequential(
          [
              tf.keras.layers.Dense(2),
              tf.keras.layers.LSTM(
                  2, return_state=True, return_sequences=True
              ),
              tf.keras.layers.RNN(
                  tf.keras.layers.StackedRNNCells(
                      [
                          tf.keras.layers.LSTMCell(1),
                          tf.keras.layers.LSTMCell(32),
                      ],
                  ),
                  return_state=True,
                  return_sequences=True,
              ),
              # Convert inner dimension to [4, 4, 2] for convolution.
              inner_reshape.InnerReshape([32], [4, 4, 2]),
              tf.keras.layers.Conv2D(2, 3),
              # Convert 3 inner dimensions to [?] for RNN.
              inner_reshape.InnerReshape([None] * 3, [-1]),
              tf.keras.layers.GRU(
                  2, return_state=True, return_sequences=True
              ),
              dynamic_unroll_layer.DynamicUnroll(
                  tf.keras.layers.LSTMCell(2)
              ),
              tf.keras.layers.Lambda(
                  lambda x: tfd.MultivariateNormalDiag(
                      loc=x, scale_diag=x
                  )
              ),
          ],
          input_spec=tf.TensorSpec((3,), tf.float32),
      )  # pytype: disable=wrong-arg-types
      self.assertEqual(
          sequential.input_tensor_spec, tf.TensorSpec((3,), tf.float32)
      )
  
      output_spec = sequential.create_variables()
      self.assertIsInstance(
          output_spec, distribution_utils.DistributionSpecV2
      )
      output_event_spec = output_spec.event_spec
      self.assertEqual(
          output_event_spec, tf.TensorSpec((2,), dtype=tf.float32)
      )
  
      tf.nest.map_structure(
          self.assertEqual,
          sequential.state_spec,
          (
              (  # LSTM
                  tf.TensorSpec((2,), tf.float32),
                  tf.TensorSpec((2,), tf.float32),
              ),
              (  # RNN(StackedRNNCells)
                  [
                      tf.TensorSpec((1,), tf.float32),
                      tf.TensorSpec((1,), tf.float32),
                  ],
                  [
                      tf.TensorSpec((32,), tf.float32),
                      tf.TensorSpec((32,), tf.float32),
                  ],
              ),
              # GRU
              tf.TensorSpec((2,), tf.float32),
              (  # DynamicUnroll
                  tf.TensorSpec((2,), tf.float32),
                  tf.TensorSpec((2,), tf.float32),
              ),
          ),
      )
  
      inputs = tf.ones((8, 10, 3), dtype=tf.float32)
      dist, _ = sequential(inputs)
      outputs = dist.sample()
      self.assertEqual(outputs.shape, tf.TensorShape([8, 10, 2]))
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  from absl import flags
  import numpy
  import tensorflow
  import tensorflow_probability
  from tf_agents.distributions import utils
  from tf_agents.keras_layers import dynamic_unroll_layer
  from tf_agents.keras_layers import inner_reshape
  from tf_agents.networks import nest_map
  from tf_agents.networks import network
  from tf_agents.networks import sequential
  from tf_agents.policies import actor_policy
  from tf_agents.policies import policy_saver
  from tf_agents.specs import tensor_spec
  from tf_agents.trajectories import time_step
  from tf_agents.utils import common
  from tf_agents.utils import test_utils
label_desc: Use image node_id 3 for calling the SequentialTest obj's underlying member method code with example usage: obj.testMixOfNonRecurrentAndRecurrent() without return types