class_docstr: Recurrent neural network layer which is unrolled over the sequence of timesteps (per episode),
  that is, the RNN cell is applied to the layer input at each timestep and the RNN consequently
  maintains a temporal internal state over the course of an episode (specification key: `rnn`).
  
  Args:
      cell ('gru' | 'lstm'): The recurrent cell type
          (<span style="color:#C00000"><b>required</b></span>).
      size (int >= 0): Layer output size, 0 implies additionally removing the axis
          (<span style="color:#C00000"><b>required</b></span>).
      horizon (parameter, int >= 0): Past horizon, for truncated backpropagation through time
          (<span style="color:#C00000"><b>required</b></span>).
      bias (bool): Whether to add a trainable bias variable
          (<span style="color:#00C000"><b>default</b></span>: true).
      activation ('crelu' | 'elu' | 'leaky-relu' | 'none' | 'relu' | 'selu' | 'sigmoid' |
          'softmax' | 'softplus' | 'softsign' | 'swish' | 'tanh'): Activation nonlinearity
          (<span style="color:#00C000"><b>default</b></span>: tanh).
      dropout (parameter, 0.0 <= float < 1.0): Dropout rate
          (<span style="color:#00C000"><b>default</b></span>: 0.0).
      vars_trainable (bool): Whether layer variables are trainable
          (<span style="color:#00C000"><b>default</b></span>: true).
      l2_regularization (float >= 0.0): Scalar controlling L2 regularization
          (<span style="color:#00C000"><b>default</b></span>: inherit value of parent module).
      name (string): Layer name
          (<span style="color:#00C000"><b>default</b></span>: internally chosen).
      input_spec (specification): <span style="color:#00C000"><b>internal use</b></span>.
      kwargs: Additional arguments for Keras RNN cell layer, see
          `TensorFlow docs <https://www.tensorflow.org/api_docs/python/tf/keras/layers>`__.
code: def __init__(
      self,
      *,
      cell,
      size,
      horizon,
      bias=True,
      activation="tanh",
      dropout=0.0,
      vars_trainable=True,
      l2_regularization=None,
      name=None,
      input_spec=None,
      **kwargs,
  ):
      if bias:
          # Hack for TransformationBase to avoid name clash with Keras variable name
          bias = "_bias"
  
      super().__init__(
          temporal_processing="iterative",
          horizon=horizon,
          size=size,
          bias=bias,
          activation=activation,
          dropout=dropout,
          vars_trainable=vars_trainable,
          l2_regularization=l2_regularization,
          name=name,
          input_spec=input_spec,
      )
  
      self.cell_type = cell
      if self.cell_type == "gru":
          self.cell = tf.keras.layers.GRUCell(
              units=self.size,
              name="cell",
              **kwargs,  # , dtype=tf_util.get_dtype(type='float')
          )
      elif self.cell_type == "lstm":
          self.cell = tf.keras.layers.LSTMCell(
              units=self.size,
              name="cell",
              **kwargs,  # , dtype=tf_util.get_dtype(type='float')
          )
      else:
          raise TensorforceError.value(
              name="Rnn",
              argument="cell",
              value=self.cell_type,
              hint="not in {gru,lstm}",
          )
  
      self.architecture_kwargs["cell"] = cell
      self.architecture_kwargs["size"] = str(size)
      self.architecture_kwargs["horizon"] = str(horizon)
      self.architecture_kwargs["bias"] = str(bias)
      if activation is not None:
          self.architecture_kwargs["activation"] = str(activation)
      if dropout != 0.0:
          self.architecture_kwargs["dropout"] = str(dropout)
      if not vars_trainable:
          self.architecture_kwargs["trainable"] = str(vars_trainable)
      if l2_regularization is not None:
          self.architecture_kwargs["l2_regularization"] = str(
              l2_regularization
          )
  
imports: import numpy
  import tensorflow
  from tensorforce import TensorforceError, util
  from tensorforce.core import TensorSpec, tf_function, tf_util
  from tensorforce.core.layers import TemporalLayer, TransformationBase
label_desc: Use image node_id 1 to create a new Rnn object from inherited base classes: TemporalLayer, TransformationBase with example: obj = Rnn()