class_docstr: Replay memory which randomly retrieves experiences (specification key: `replay`).
  
  Args:
      capacity (int > 0): Memory capacity
          (<span style="color:#00C000"><b>default</b></span>: minimum capacity).
      device (string): Device name
          (<span style="color:#00C000"><b>default</b></span>: CPU:0).
      name (string): <span style="color:#0000C0"><b>internal use</b></span>.
      values_spec (specification): <span style="color:#0000C0"><b>internal use</b></span>.
      min_capacity (int >= 0): <span style="color:#0000C0"><b>internal use</b></span>.
code: def retrieve_episodes(self, *, n):
      zero = tf_util.constant(value=0, dtype="int")
      one = tf_util.constant(value=1, dtype="int")
      capacity = tf_util.constant(value=self.capacity, dtype="int")
  
      # Check whether memory contains at least one episode
      assertions = list()
      if self.config.create_tf_assertions:
          assertions.append(
              tf.debugging.assert_greater_equal(
                  x=self.episode_count, y=one
              )
          )
  
      # Get start and limit indices for randomly sampled n episodes
      with tf.control_dependencies(control_inputs=assertions):
          n = tf.math.minimum(x=n, y=self.episode_count)
          random_indices = tf.random.uniform(
              shape=(n,),
              maxval=self.episode_count,
              dtype=tf_util.get_dtype(type="int"),
          )
  
          # (Increment terminal of previous episode)
          starts = (
              tf.gather(
                  params=self.terminal_indices, indices=random_indices
              )
              + one
          )
          limits = (
              tf.gather(
                  params=self.terminal_indices,
                  indices=(random_indices + one),
              )
              + one
          )
  
          # Correct limit index if smaller than start index
          limits = limits + tf.where(
              condition=(limits < starts), x=capacity, y=zero
          )
  
          # Random episode indices ranges
          indices = tf.ragged.range(starts=starts, limits=limits).values
          indices = tf.math.mod(x=indices, y=capacity)
  
      return indices
  
imports: import tensorflow
  from tensorforce.core import tf_function, tf_util
  from tensorforce.core.memories import Queue
label_desc: Use image node_id 2 for calling the Replay obj's underlying member method code with example usage: obj.retrieve_episodes() and returns: indices