code: def testClearAll(self):
      spec = specs.TensorSpec([3], tf.int32, "lidar")
      values = tf.expand_dims(
          np.ones(spec.shape.as_list(), dtype=np.int32), 0
      )
  
      empty_values = np.empty((0, 3), dtype=np.int32)
      replay_buffer = episodic_replay_buffer.EpisodicReplayBuffer(
          spec,
          capacity=2,
          begin_episode_fn=lambda _: False,
          end_episode_fn=lambda _: False,
      )
  
      episode_id_1 = replay_buffer.create_episode_ids(1)
      episode_id_2 = replay_buffer.create_episode_ids(1)
  
      self.evaluate(tf.compat.v1.global_variables_initializer())
      self.evaluate(tf.compat.v1.local_variables_initializer())
  
      self.assertAllEqual(
          self.evaluate(replay_buffer.gather_all()), empty_values
      )
      self.assertEqual(self.evaluate(replay_buffer._last_episode), -1)
      self.assertAllEqual(
          self.evaluate(replay_buffer._episode_lengths), [0, 0]
      )
  
      self.evaluate(replay_buffer.add_batch(values, episode_id_1))
      self.assertAllEqual(
          self.evaluate(replay_buffer.gather_all())[0], values
      )
      self.assertEqual(self.evaluate(replay_buffer._last_episode), 0)
      self.assertAllEqual(
          self.evaluate(replay_buffer._episode_lengths), [1, 0]
      )
  
      self.evaluate(replay_buffer.clear())
      self.assertAllEqual(
          self.evaluate(replay_buffer.gather_all()), empty_values
      )
      self.assertEqual(self.evaluate(replay_buffer._last_episode), 0)
      self.assertAllEqual(
          self.evaluate(replay_buffer._episode_lengths), [0, 0]
      )
  
      self.evaluate(replay_buffer.add_batch(values, episode_id_2))
      self.assertAllEqual(
          self.evaluate(replay_buffer.gather_all())[0], values
      )
      self.evaluate(replay_buffer._clear(clear_all_variables=True))
      self.assertAllEqual(
          self.evaluate(replay_buffer.gather_all()), empty_values
      )
      self.assertEqual(self.evaluate(replay_buffer._last_episode), -1)
      self.assertAllEqual(
          self.evaluate(replay_buffer._episode_lengths), [0, 0]
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl.testing import parameterized
  import numpy
  import tensorflow
  from tf_agents import specs
  from tf_agents.replay_buffers import episodic_replay_buffer
  from tf_agents.utils import common
  from tf_agents.utils import test_utils
  from tensorflow.python.ops import list_ops
label_desc: Use image node_id 29 for calling the EpisodicReplayBufferTest obj's underlying member method code with example usage: obj.testClearAll() without return types