class_docstr: An episodic ReplayBuffer with Uniform sampling.
class_docstr_tok: ["An","episodic","ReplayBuffer","with","Uniform","sampling","."]
docstr: Mark episode ID as complete when end_episode is True.
  
  Args:
    episode_id: A Tensor containing the current episode_id.
    end_episode: A Boolean Tensor whether should end the episode_id.
  
  Returns:
    A Boolean Tensor whether the episode was marked as complete.
code: def _maybe_end_episode(self, episode_id, end_episode=False):
      """Mark episode ID as complete when end_episode is True.
  
      Args:
        episode_id: A Tensor containing the current episode_id.
        end_episode: A Boolean Tensor whether should end the episode_id.
  
      Returns:
        A Boolean Tensor whether the episode was marked as complete.
      """
      episode_location = self._get_episode_id_location(episode_id)
  
      def _maybe_end_episode_id():
          """Maybe end episode ID."""
  
          def _end_episode_id():
              return tf.group(
                  tf.compat.v1.scatter_update(
                      self._episode_completed, [episode_location], 1
                  )
              )
  
          episode_valid = tf.equal(
              self._episodes_loc_to_id_map.sparse_read(
                  episode_location
              ),
              episode_id,
          )
  
          pred_value = end_episode & (episode_id >= 0) & episode_valid
          if pred_value.shape.rank != 0:
              raise ValueError(
                  "Invalid condition shape: {} (should be scalar).".format(
                      pred_value.shape
                  )
              )
          maybe_end = tf.cond(
              pred=pred_value,
              true_fn=_end_episode_id,
              false_fn=tf.no_op,
              name="maybe_end_episode_id",
          )
          with tf.control_dependencies([maybe_end]):
              return (
                  self._episode_completed.sparse_read(episode_location)
                  > 0
              )
  
      return self._add_episode_critical_section.execute(
          _maybe_end_episode_id
      )
  
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 17 for calling the EpisodicReplayBuffer obj's underlying member method code with example usage: obj._maybe_end_episode(episode_id, end_episode) and returns: self, tf, unknown