class_docstr: The Sequential Network represents a sequence of Keras layers.
  
  It is a TF-Agents network that should be used instead of
  tf.keras.layers.Sequential. In contrast to keras Sequential, this layer can be
  used as a pure Layer in tf.functions and when exporting SavedModels, without
  having to pre-declare input and output shapes. In turn, this layer is usable
  as a preprocessing layer for TF Agents Networks, and can be exported via
  PolicySaver.
  
  Stateful Keras layers (e.g. LSTMCell, RNN, LSTM, TF-Agents DynamicUnroll)
  are all supported.  The `state_spec` of `Sequential` is a tuple whose
  length matches the number of stateful layers passed.  If no stateful layers
  or networks are passed to `Sequential` then `state_spec == ()`. Given that
  the replay buffers do not support specs with lists due to tf.nest vs
  tf.data.nest conflicts `Sequential` will also guarantee that all specs do not
  contain lists.
  
  Usage:
  ```python
  c = Sequential([layer1, layer2, layer3])
  output, next_state = c(inputs, state)
  ```
code: def call(self, inputs, network_state=(), **kwargs):
      if not tf.is_tensor(network_state) and not network_state:
          network_state = ((),) * len(self.state_spec)
      next_network_state = [()] * len(self.state_spec)
  
      # Only Networks are expected to know about step_type; not Keras layers.
      layer_kwargs = kwargs.copy()
      layer_kwargs.pop("step_type", None)
  
      stateful_layer_idx = 0
      for i, layer in enumerate(self.layers):
          if isinstance(layer, network.Network):
              if self._layer_has_state[i]:
                  input_state = network_state[stateful_layer_idx]
  
                  if (
                      input_state is not None
                      and self._layer_state_is_list[i]
                  ):
                      input_state = list(input_state)
  
                  inputs, next_state = layer(
                      inputs,
                      network_state=network_state[stateful_layer_idx],
                      **kwargs,
                  )
  
                  if self._layer_state_is_list[i]:
                      next_network_state[stateful_layer_idx] = tuple(
                          next_state
                      )
                  else:
                      next_network_state[
                          stateful_layer_idx
                      ] = next_state
  
                  stateful_layer_idx += 1
              else:
                  inputs, _ = layer(inputs, **kwargs)
          else:
              # Generic Keras layer
              if self._layer_has_state[i]:
                  # The layer maintains state.  If a state was provided at input to
                  # `call`, then use it.  Otherwise ask for an initial state.
                  maybe_network_state = network_state[
                      stateful_layer_idx
                  ]
  
                  input_state = maybe_network_state
  
                  if maybe_network_state is None:
                      input_state = layer.get_initial_state(inputs)
                  elif (
                      common.safe_has_state(input_state)
                      and self._layer_state_is_list[i]
                  ):
                      input_state = list(input_state)
  
                  outputs = layer(inputs, input_state, **layer_kwargs)
                  inputs, next_state = outputs
  
                  if self._layer_state_is_list[i]:
                      next_network_state[stateful_layer_idx] = tuple(
                          next_state
                      )
                  else:
                      next_network_state[
                          stateful_layer_idx
                      ] = next_state
  
                  stateful_layer_idx += 1
              else:
                  # Does not maintain state.
                  inputs = layer(inputs, **layer_kwargs)
  
      return inputs, tuple(next_network_state)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import copy
  from typing import Any, List, Mapping, Optional, Sequence, Text, Tuple, Union
  import tensorflow
  from tf_agents.keras_layers import rnn_wrapper
  from tf_agents.networks import network
  from tf_agents.typing import types
  from tf_agents.utils import common
label_desc: Use image node_id 4 for calling the Sequential obj's underlying member method code with example usage: obj.call(inputs, network_state) and returns: inputs,  tuple