class_docstr: Wraps a Keras RNN/LSTM/GRU layer to make network state more consistent.
docstr: Create a `RNNWrapper`.
  
  Args:
    layer: An instance of `tf.keras.layers.RNN` or subclasses (including
      `tf.keras.layers.{LSTM,GRU,...}`.
    **kwargs: Extra args to `Layer` parent class.
  
  Raises:
    TypeError: If `layer` is not a subclass of `tf.keras.layers.RNN`.
    NotImplementedError: If `layer` was created with `return_state == False`.
    NotImplementederror: If `layer` was created with
      `return_sequences == False`.
docstr_tok: ["Create","a","`","RNNWrapper","`",".","Args",":","layer",":","An","instance","of","`","tf.keras.layers.RNN","`","or","subclasses","(","including","`","tf.keras.layers.","{","LSTM",",","GRU",",","...","}","`",".","*","*","kwargs",":","Extra","args","to","`","Layer","`","parent","class",".","Raises",":","TypeError",":","If","`","layer","`","is","not","a","subclass","of","`","tf.keras.layers.RNN","`",".","NotImplementedError",":","If","`","layer","`","was","created","with","`","return_state","==","False","`",".","NotImplementederror",":","If","`","layer","`","was","created","with","`","return_sequences","==","False","`","."]
code: def __init__(self, layer: tf.keras.layers.RNN, **kwargs):
      """Create a `RNNWrapper`.
  
      Args:
        layer: An instance of `tf.keras.layers.RNN` or subclasses (including
          `tf.keras.layers.{LSTM,GRU,...}`.
        **kwargs: Extra args to `Layer` parent class.
  
      Raises:
        TypeError: If `layer` is not a subclass of `tf.keras.layers.RNN`.
        NotImplementedError: If `layer` was created with `return_state == False`.
        NotImplementederror: If `layer` was created with
          `return_sequences == False`.
      """
      if not isinstance(layer, tf.keras.layers.RNN):
          raise TypeError(
              "layer is not a subclass of tf.keras.layers.RNN.  Layer: {}".format(
                  layer
              )
          )
      layer_config = layer.get_config()
      if not layer_config.get("return_state", False):
          # This is an RNN layer that doesn't return state.
          raise NotImplementedError(
              "Provided a Keras RNN layer with return_state==False. "
              "This configuration is not supported.  Layer: {}".format(
                  layer
              )
          )
      if not layer_config.get("return_sequences", False):
          raise NotImplementedError(
              "Provided a Keras RNN layer with return_sequences==False. "
              "This configuration is not supported.  Layer: {}".format(
                  layer
              )
          )
  
      self._layer = layer
      super(RNNWrapper, self).__init__(**kwargs)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import tensorflow
  from tf_agents.utils import common
label_desc: Use image node_id 1 to create a new RNNWrapper object from inherited base classes: tf.keras.layers with example: obj = RNNWrapper(layer)