code: def testNumActionsFromTensorSpecWrongRank(self):
      action_spec = tensor_spec.BoundedTensorSpec(
          dtype=tf.int32, shape=(2, 3), minimum=0, maximum=15
      )
  
      with self.assertRaisesRegex(
          ValueError, r"Action spec must be a scalar"
      ):
          policy_utilities.get_num_actions_from_tensor_spec(action_spec)
  
file_path: agents/tf_agents/bandits/policies/policy_utilities_test.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl.testing import parameterized
  import tensorflow
  from tf_agents.policies import utils
  from tf_agents.specs import tensor_spec
  from tf_agents.trajectories import policy_step
  from tf_agents.utils import test_utils
label_desc: Use image node_id 4 for calling the PolicyUtilitiesTest obj's underlying member method code with example usage: obj.testNumActionsFromTensorSpecWrongRank() without return types