code: def test_score(self, num_cem_samples, seq_size, anchor_point):
      # Test that the scores are same now as they were with the map_fn in the
      # cem while loop.
      batch_size = 2
      action_size = 8
      num_iters = 3
      obs_spec = tf.TensorSpec([1], tf.float32)
      action_spec = tensor_spec.BoundedTensorSpec(
          [action_size], tf.float32, 0.0, 1.0
      )
      cem_agent = qtopt_cem_policy.CEMPolicy(
          self._time_step_spec,
          self._action_spec,
          q_network=DummyNet(
              (obs_spec, action_spec), anchor_point=anchor_point
          ),
          num_samples=num_cem_samples,
          init_mean=None,
          init_var=None,
          sampler=None,
          num_iterations=num_iters,
      )
      sample_actions = tf.random.uniform(
          [batch_size * seq_size, num_cem_samples, action_size]
      )  # [BxT, N, A]
  
      # Calculate the scores [without the map_fn]
      if seq_size == 1:
          scores, _ = cem_agent._score(
              observation=tf.zeros([batch_size, seq_size, 1]),
              sample_actions=sample_actions,
              step_type=(),
              policy_state=(),
          )
      else:
          scores, _ = cem_agent._score_with_time(
              observation=tf.zeros([batch_size, seq_size, 1]),
              sample_actions=sample_actions,
              step_type=(),
              policy_state=(),
              seq_size=seq_size,
          )
  
      # Calculate scores with the map_fn
      orig_scores = self._score_with_map_fn(
          observation=tf.zeros([batch_size, 1]),
          sample_actions=tf.transpose(sample_actions, [1, 0, 2]),
          q_network=DummyNet(
              (obs_spec, action_spec), anchor_point=anchor_point
          ),
      )
  
      self.assertAllEqual(
          scores.shape, (batch_size * seq_size, num_cem_samples)
      )
      logging.info(scores)
      logging.info(orig_scores)
  
      # Evaluates scores and orig_scores at the same time so that they share the
      # same random inputs.
      scores_value, orig_scores_value = self.evaluate(
          [scores, orig_scores]
      )
      self.assertAllClose(scores_value, orig_scores_value)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl import flags
  from absl import logging
  from absl.testing import parameterized
  import numpy
  import tensorflow
  import tensorflow_probability
  from tf_agents.networks import network
  from tf_agents.policies import qtopt_cem_policy
  from tf_agents.policies.samplers import qtopt_cem_actions_sampler_continuous
  from tf_agents.policies.samplers import qtopt_cem_actions_sampler_continuous_and_one_hot
  from tf_agents.policies.samplers import qtopt_cem_actions_sampler_hybrid
  from tf_agents.specs import tensor_spec
  from tf_agents.trajectories import time_step
label_desc: Use image node_id 6 for calling the CEMPolicyTest obj's underlying member method code with example usage: obj.test_score(num_cem_samples, seq_size, anchor_point) without return types