code: def testSampleBatch(self):
      action_spec = (
          tensor_spec.BoundedTensorSpec(
              [_ACTION_SIZE], tf.float32, 0.0, 1.0
          ),
          tensor_spec.BoundedTensorSpec([_ACTION_SIZE], tf.int32, 0, 1),
      )
      sampler = qtopt_cem_actions_sampler_hybrid.GaussianActionsSampler(
          action_spec=action_spec
      )
  
      mean = tf.constant(_MEAN)
      var = tf.constant(_VAR)
      mean = (
          tf.broadcast_to(mean, [_BATCH, _ACTION_SIZE]),
          tf.broadcast_to(mean, [_BATCH, _ACTION_SIZE]),
      )
      var = (
          tf.broadcast_to(var, [_BATCH, _ACTION_SIZE]),
          tf.broadcast_to(var, [_BATCH, _ACTION_SIZE]),
      )
  
      actions = sampler.sample_batch_and_clip(_NUM_SAMPLES, mean, var)
      self.assertEqual(
          [_BATCH, _NUM_SAMPLES, _ACTION_SIZE], actions[0].shape
      )
      self.assertEqual(
          [_BATCH, _NUM_SAMPLES, _ACTION_SIZE], actions[1].shape
      )
  
      actions_ = self.evaluate(actions)
      flat_actions = tf.nest.flatten(actions_)
      flat_action_spec = tf.nest.flatten(action_spec)
      for i in range(len(flat_action_spec)):
          self.assertTrue(
              (flat_actions[i] <= flat_action_spec[i].maximum).all()
          )
          self.assertTrue(
              (flat_actions[i] >= flat_action_spec[i].minimum).all()
          )
  
file_path: agents/tf_agents/policies/samplers/qtopt_cem_actions_sampler_hybrid_test.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import tensorflow
  from tf_agents.policies.samplers import qtopt_cem_actions_sampler_hybrid
  from tf_agents.specs import tensor_spec
label_desc: Use image node_id 1 for calling the ActionsSamplerTest obj's underlying member method code with example usage: obj.testSampleBatch() without return types