class_docstr: An episodic ReplayBuffer with Uniform sampling.
class_docstr_tok: ["An","episodic","ReplayBuffer","with","Uniform","sampling","."]
docstr: Returns all the items currently in the buffer.
  
  Returns:
    A tuple containing two entries:
      - All the items currently in the buffer (nested).
      - The items ids.
  
  Raises:
    ValueError: If the data spec contains lists that must be converted to
      tuples.
code: def _gather_all(self):
      """Returns all the items currently in the buffer.
  
      Returns:
        A tuple containing two entries:
          - All the items currently in the buffer (nested).
          - The items ids.
  
      Raises:
        ValueError: If the data spec contains lists that must be converted to
          tuples.
      """
      if tf.nest.flatten(self._data_spec) != data_nest.flatten(
          self._data_spec
      ):
          raise ValueError(
              "Cannot perform gather; data spec contains lists and this conflicts "
              "with gathering operator.  Convert any lists to tuples.  "
              "For example, if your spec looks like [a, b, c], "
              "change it to (a, b, c).  Spec structure is:\n  %s"
              % tf.nest.map_structure(
                  lambda spec: spec.dtype, self._data_spec
              )
          )
  
      min_val, max_val = _valid_range_ids(
          self._get_last_episode_id(), self._capacity
      )
  
      def get_episode_and_id(id_):
          row = self._get_episode_id_location(id_)
          data = self._data_table.get_episode_values(row)
          n = tf.shape(tf.nest.flatten(data)[0])[0]
          id_repeated = tf.fill([n], id_)
          return (tuple(tf.nest.flatten(data)), id_repeated)
  
      episode_lengths = self._episode_lengths.read_value()
      if self._completed_only:
          episode_lengths *= tf.cast(
              self._episode_completed, dtype=tf.int64
          )
      total_length = tf.reduce_sum(input_tensor=episode_lengths)
  
      def via_iterator():
          """If total_length > 0, create a dataset iterator to concat episodes."""
          valid_episodes = tf.range(min_val, max_val)
          ds = tf.data.Dataset.from_tensor_slices(valid_episodes)
  
          if self._completed_only:
              # Filter out incomplete episodes.
              def check_completed(id_):
                  return tf.cast(
                      self._episode_completed.sparse_read(id_), tf.bool
                  )
  
              ds = ds.filter(check_completed)
  
          def _unflatten(flat_data, id_):
              return (
                  tf.nest.pack_sequence_as(self._data_spec, flat_data),
                  id_,
              )
  
          ds = (
              ds.map(get_episode_and_id)
              .unbatch()
              # Batch all the frames in the buffer.  Request a larger amount in
              # case the buffer grows between the construction of total_length and
              # the call to .map().
              .batch(10 + 2 * total_length)
              .map(_unflatten)
          ).batch(1)
  
          # Use ds.take(1) in case we haven't requested a large enough batch (the
          # replay buffer has grown too quickly), since get_single_element requires
          # that the dataset only has a single entry; and we don't consider this
          # case to be an error.
          return tf.data.experimental.get_single_element(ds.take(1))
  
      def empty():
          def _empty_from_spec(spec):
              return tf.zeros(
                  [0] + spec.shape.as_list(), spec.dtype, name="empty"
              )
  
          empty_data = tf.nest.map_structure(
              _empty_from_spec, self._data_spec
          )
          empty_id = tf.zeros([], dtype=tf.int64)
          return empty_data, empty_id
  
      return tf.cond(
          pred=total_length > 0, true_fn=via_iterator, false_fn=empty
      )
  
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 13 for calling the EpisodicReplayBuffer obj's underlying member method code with example usage: obj._gather_all() and returns: tf, tuple,  id_repeated, tf, empty_data,  empty_id, tf,  id_, tf, tf