class_docstr: A set of tests for the Learner.
class_docstr_tok: ["A","set","of","tests","for","the","Learner","."]
code: def testLearnerRaiseExceptionOnMismatchingBatchSetup(self):
      obs_spec = tensor_spec.TensorSpec([2], tf.float32)
      time_step_spec = ts.time_step_spec(obs_spec)
      action_spec = tensor_spec.BoundedTensorSpec([], tf.int32, 0, 1)
      flat_action_spec = tf.nest.flatten(action_spec)[0]
      num_actions = (
          flat_action_spec.maximum - flat_action_spec.minimum + 1
      )
  
      network = sequential.Sequential(
          [
              tf.keras.layers.Dense(num_actions, dtype=tf.float32),
              inner_reshape.InnerReshape([None], [num_actions]),
          ]
      )
  
      agent = behavioral_cloning_agent.BehavioralCloningAgent(
          time_step_spec,
          action_spec,
          cloning_network=network,
          optimizer=None,
      )
  
      with self.assertRaisesRegex(
          ValueError,
          "All of the Tensors in `value` must have one outer dimension.",
      ):
          learner.Learner(
              root_dir=os.path.join(
                  self.create_tempdir().full_path, "learner"
              ),
              train_step=train_utils.create_train_step(),
              agent=agent,
          )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import functools
  import os
  from absl import logging
  from absl.testing import parameterized
  import numpy
  from six.moves import range
  import tensorflow
  from tf_agents.agents.behavioral_cloning import behavioral_cloning_agent
  from tf_agents.environments import suite_gym
  from tf_agents.environments import tf_py_environment
  from tf_agents.keras_layers import inner_reshape
  from tf_agents.networks import sequential
  from tf_agents.specs import tensor_spec
  from tf_agents.system import system_multiprocessing
  from tf_agents.train import learner
  from tf_agents.train.utils import test_utils
  from tf_agents.train.utils import train_utils
  from tf_agents.trajectories import time_step
  from tf_agents.utils import common
  from tf_agents.utils import test_utils
label_desc: Use image node_id 8 for calling the LearnerTest obj's underlying member method code with example usage: obj.testLearnerRaiseExceptionOnMismatchingBatchSetup() without return types