class_docstr: Process a history of sequences that are concatenated without padding.
  
  Given batched, batch-major `inputs`, `DynamicUnroll` unrolls
  an RNN using `cell`; at each time step it feeds a frame of `inputs` as input
  to `cell.call()`.
  
  If at least one tensor in `inputs` has rank 3 or above (shaped
  `[batch_size, n, ...]` where `n` is the number of time steps),
  the RNN will run for exactly `n` steps.
  
  If `n == 1` is known statically, then only a single step is executed.
  This is done via a static unroll without using a `tf.while_loop`.
  
  If all of the tensors in `inputs` have rank at most `2` (i.e., shaped
  `[batch_size]` or `[batch_size, d]`, then it is assumed that a single step
  is being taken (i.e. `n = 1`) and the outputs will also not have a time
  dimension in their output.
  
  **NOTE** The `call` method optionally accepts `reset_mask` argument, which
  allows for state resets partway through a batch, at the cost of more
  computation.
docstr: Create a `DynamicUnroll` layer.
  
  Args:
    cell: A `tf.nn.rnn_cell.RNNCell` or Keras `RNNCell` (e.g. `LSTMCell`)
      whose `call()` method has the signature `call(input, state, ...)`. Each
      tensor in the tuple is shaped `[batch_size, ...]`.
    parallel_iterations: Parallel iterations to pass to `tf.while_loop`. The
      default value is a good trades off between memory use and performance.
      See documentation of `tf.while_loop` for more details.
    swap_memory: Python bool.  Whether to swap memory from GPU to CPU when
      storing activations for backprop.  This may sometimes have a negligible
      performance impact, but can improve memory usage.  See documentation of
      `tf.while_loop` for more details.
    **kwargs: Additional layer arguments, such as `dtype` and `name`.
  
  Raises:
    TypeError: if `cell` lacks `get_initial_state`, `output_size`, or
      `state_size` property.
docstr_tok: ["Create","a","`","DynamicUnroll","`","layer",".","Args",":","cell",":","A","`","tf.nn.rnn_cell.RNNCell","`","or","Keras","`","RNNCell","`","(","e.g",".","`","LSTMCell","`",")","whose","`","call","(",")","`","method","has","the","signature","`","call","(","input",",","state",",","...",")","`",".","Each","tensor","in","the","tuple","is","shaped","`","[","batch_size",",","...","]","`",".","parallel_iterations",":","Parallel","iterations","to","pass","to","`","tf.while_loop","`",".","The","default","value","is","a","good","trades","off","between","memory","use","and","performance",".","See","documentation","of","`","tf.while_loop","`","for","more","details",".","swap_memory",":","Python","bool",".","Whether","to","swap","memory","from","GPU","to","CPU","when","storing","activations","for","backprop",".","This","may","sometimes","have","a","negligible","performance","impact",",","but","can","improve","memory","usage",".","See","documentation","of","`","tf.while_loop","`","for","more","details",".","*","*","kwargs",":","Additional","layer","arguments",",","such","as","`","dtype","`","and","`","name","`",".","Raises",":","TypeError",":","if","`","cell","`","lacks","`","get_initial_state","`",",","`","output_size","`",",","or","`","state_size","`","property","."]
code: def __init__(
      self, cell, parallel_iterations=20, swap_memory=None, **kwargs
  ):
      """Create a `DynamicUnroll` layer.
  
      Args:
        cell: A `tf.nn.rnn_cell.RNNCell` or Keras `RNNCell` (e.g. `LSTMCell`)
          whose `call()` method has the signature `call(input, state, ...)`. Each
          tensor in the tuple is shaped `[batch_size, ...]`.
        parallel_iterations: Parallel iterations to pass to `tf.while_loop`. The
          default value is a good trades off between memory use and performance.
          See documentation of `tf.while_loop` for more details.
        swap_memory: Python bool.  Whether to swap memory from GPU to CPU when
          storing activations for backprop.  This may sometimes have a negligible
          performance impact, but can improve memory usage.  See documentation of
          `tf.while_loop` for more details.
        **kwargs: Additional layer arguments, such as `dtype` and `name`.
  
      Raises:
        TypeError: if `cell` lacks `get_initial_state`, `output_size`, or
          `state_size` property.
      """
      if getattr(cell, "get_initial_state", None) is None:
          raise TypeError(
              "cell lacks get_initial_state method: %s" % cell
          )
      if getattr(cell, "output_size", None) is None:
          raise TypeError("cell lacks output_size property: %s" % cell)
      if getattr(cell, "state_size", None) is None:
          raise TypeError("cell lacks state_size property: %s" % cell)
      self.cell = cell
      self.parallel_iterations = parallel_iterations
      self.swap_memory = swap_memory
      super(DynamicUnroll, 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 DynamicUnroll object from inherited base classes: tf.keras.layers with example: obj = DynamicUnroll(cell, parallel_iterations, swap_memory)