parameters: (self, episodes, length, rows=None)
docstring: Replace full episodes.
  
      Args:
        episodes: Tuple of transition quantities with batch and time dimensions.
        length: Batch of sequence lengths.
        rows: Episodes to replace, defaults to all.
  
      Returns:
        Operation.
docstring_summary: Replace full episodes.
docstring_tokens: Replace full episodes .
function: def replace(self, episodes, length, rows=None):
      """Replace full episodes.
  
      Args:
        episodes: Tuple of transition quantities with batch and time dimensions.
        length: Batch of sequence lengths.
        rows: Episodes to replace, defaults to all.
  
      Returns:
        Operation.
      """
      rows = tf.range(self._capacity) if rows is None else rows
      assert rows.shape.ndims == 1
      assert_capacity = tf.assert_less(rows, self._capacity, message='capacity exceeded')
      with tf.control_dependencies([assert_capacity]):
        assert_max_length = tf.assert_less_equal(length,
                                                 self._max_length,
                                                 message='max length exceeded')
      replace_ops = []
      with tf.control_dependencies([assert_max_length]):
        for buffer_, elements in zip(self._buffers, episodes):
          replace_op = tf.scatter_update(buffer_, rows, elements)
          replace_ops.append(replace_op)
      with tf.control_dependencies(replace_ops):
        return tf.scatter_update(self._length, rows, length)
function_tokens: def replace ( self , episodes , length , rows = None ) : rows = tf . range ( self . _capacity ) if rows is None else rows assert rows . shape . ndims == 1 assert_capacity = tf . assert_less ( rows , self . _capacity , message = 'capacity exceeded' ) with tf . control_dependencies ( [ assert_capacity ] ) : assert_max_length = tf . assert_less_equal ( length , self . _max_length , message = 'max length exceeded' ) replace_ops = [ ] with tf . control_dependencies ( [ assert_max_length ] ) : for buffer_ , elements in zip ( self . _buffers , episodes ) : replace_op = tf . scatter_update ( buffer_ , rows , elements ) replace_ops . append ( replace_op ) with tf . control_dependencies ( replace_ops ) : return tf . scatter_update ( self . _length , rows , length )