class_docstr: An episodic ReplayBuffer with Uniform sampling.
class_docstr_tok: ["An","episodic","ReplayBuffer","with","Uniform","sampling","."]
docstr: Extracts Episodes with the given IDs.
  
  Args:
    locations: A `1-D` Tensor of locations to extract from (note, this is NOT
      the same as an episode ids variable).  It's up to the user to ensure
      that only valid episode locations are requested (i.e., values should be
      between `0` and `self.capacity`). Passing locations that are out of
      bounds will lead to runtime errors.
    clear_data: If `True`, clears the extracted data from this buffer.
  
  Returns:
    episodes: An Episodes object with an outer dimension of the same size as
      locations.
code: def extract(self, locations, clear_data=False):
      """Extracts Episodes with the given IDs.
  
      Args:
        locations: A `1-D` Tensor of locations to extract from (note, this is NOT
          the same as an episode ids variable).  It's up to the user to ensure
          that only valid episode locations are requested (i.e., values should be
          between `0` and `self.capacity`). Passing locations that are out of
          bounds will lead to runtime errors.
        clear_data: If `True`, clears the extracted data from this buffer.
  
      Returns:
        episodes: An Episodes object with an outer dimension of the same size as
          locations.
      """
      locations = tf.cast(locations, dtype=tf.int64, name="locations")
      locations.shape.assert_has_rank(1)
  
      def _extract_locked():
          """Does the above within the buffer's critical section."""
          episodes = Episodes(
              length=self._episode_lengths.sparse_read(locations),
              completed=self._episode_completed.sparse_read(locations),
              tensor_lists=self._data_table.get_episode_lists(
                  locations
              ),
          )
          if clear_data:
              with tf.control_dependencies(tf.nest.flatten(episodes)):
                  clear_rows = self._data_table.clear_rows(locations)
                  clear_lengths = tf.compat.v1.scatter_update(
                      self._episode_lengths, locations, 0
                  )
                  clear_completed = tf.compat.v1.scatter_update(
                      self._episode_completed, locations, 0
                  )
              with tf.control_dependencies(
                  [clear_rows, clear_lengths, clear_completed]
              ):
                  episodes = tf.nest.map_structure(
                      tf.identity, episodes
                  )
          return episodes
  
      with tf.device(self._device):
          with tf.name_scope("extract"):
              return self._add_episode_critical_section.execute(
                  _extract_locked
              )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  import gin
  import tensorflow
  from tf_agents import specs
  from tf_agents.replay_buffers import episodic_table
  from tf_agents.replay_buffers import replay_buffer
  from tf_agents.replay_buffers import table
  from tf_agents.utils import common
  from tensorflow.python.data.util import nest
  from tensorflow.python.layers import utils
  from tensorflow.python.ops import list_ops
  from tensorflow.python.ops.distributions import util
label_desc: Use image node_id 27 for calling the EpisodicReplayBuffer obj's underlying member method code with example usage: obj.extract(locations, clear_data) and returns: episodes, self