code: def testInvalidActionSpec(self):
      action_spec = tensor_spec.BoundedTensorSpec(
          [_ACTION_SIZE_CONTINUOUS], tf.float32, 0.0, 1.0
      )
      with self.assertRaisesRegex(
          ValueError,
          r"Only continuous action \+ 1 one_hot action is supported"
          " by this sampler.*",
      ):
          qtopt_cem_actions_sampler_continuous_and_one_hot.GaussianActionsSampler(
              action_spec=action_spec
          )
  
      action_spec = [
          tensor_spec.BoundedTensorSpec(
              [_ACTION_SIZE_DISCRETE, _ACTION_SIZE_DISCRETE],
              tf.float32,
              0.0,
              1.0,
          ),
          tensor_spec.BoundedTensorSpec(
              [_ACTION_SIZE_CONTINUOUS], tf.float32, 0.0, 1.0
          ),
      ]
      with self.assertRaisesRegex(
          ValueError, "Only 1d action is supported by this sampler.*"
      ):
          qtopt_cem_actions_sampler_continuous_and_one_hot.GaussianActionsSampler(
              action_spec=action_spec
          )
  
file_path: agents/tf_agents/policies/samplers/qtopt_cem_actions_sampler_continuous_and_one_hot_test.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  import tensorflow
  from tf_agents.policies.samplers import qtopt_cem_actions_sampler_continuous_and_one_hot
  from tf_agents.specs import tensor_spec
label_desc: Use image node_id 2 for calling the ActionsSamplerTest obj's underlying member method code with example usage: obj.testInvalidActionSpec() without return types