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:
    batch_episode_ids: A Tensor int64 with a batch of episode_ids with shape
      `(batch_size,)`.
    end_episode: A Boolean Tensor whether should end all batch_episode_ids, or
      Tensor with shape `(batch_size,)` to mark which ones to end.
  
  Returns:
    A `bool` Tensor `(batch_size,)` with the episode_ids marked as complete.
code: def _maybe_end_batch_episodes(
      self, batch_episode_ids, end_episode=False
  ):
      """Mark episode ID as complete when end_episode is True.
  
      Args:
        batch_episode_ids: A Tensor int64 with a batch of episode_ids with shape
          `(batch_size,)`.
        end_episode: A Boolean Tensor whether should end all batch_episode_ids, or
          Tensor with shape `(batch_size,)` to mark which ones to end.
  
      Returns:
        A `bool` Tensor `(batch_size,)` with the episode_ids marked as complete.
      """
      episodes_location = self._get_episode_id_location(
          batch_episode_ids
      )
  
      def _execute():
          """Maybe end episode ID."""
          valid_episodes = tf.equal(
              batch_episode_ids,
              self._episodes_loc_to_id_map.sparse_read(
                  episodes_location
              ),
          )
          maybe_end_mask = (
              end_episode & (batch_episode_ids >= 0) & valid_episodes
          )
          episodes_location_ = tf.boolean_mask(
              tensor=episodes_location, mask=maybe_end_mask
          )
          update_completed = tf.compat.v1.scatter_update(
              self._episode_completed, episodes_location_, 1
          )
          with tf.control_dependencies([update_completed]):
              return (
                  self._episode_completed.sparse_read(episodes_location)
                  > 0
              )
  
      return self._add_episode_critical_section.execute(_execute)
  
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 18 for calling the EpisodicReplayBuffer obj's underlying member method code with example usage: obj._maybe_end_batch_episodes(batch_episode_ids, end_episode) and returns: self, unknown