code: def test_bad_reshape_size(self):
      dims = 2
      new_batch_shape = [2, 3]
      old_batch_shape = [2]  # 2 != 2*3
  
      new_batch_shape_ph = (
          tf.constant(np.int32(new_batch_shape))
          if self.is_static_shape
          else tf1.placeholder_with_default(
              np.int32(new_batch_shape), shape=None
          )
      )
  
      scale = np.ones(old_batch_shape + [dims], self.dtype)
      scale_ph = tf1.placeholder_with_default(
          scale, shape=scale.shape if self.is_static_shape else None
      )
      mvn = mvn_diag.MultivariateNormalDiag(
          scale_diag=scale_ph, validate_args=True
      )
  
      if self.is_static_shape or tf.executing_eagerly():
          with self.assertRaisesRegexp(
              ValueError,
              (
                  r"`batch_shape` size \(6\) must match "
                  r"`distribution\.batch_shape` size \(2\)"
              ),
          ):
              batch_reshape.BatchReshape(
                  distribution=mvn,
                  batch_shape=new_batch_shape_ph,
                  validate_args=True,
              )
  
      else:
          with self.assertRaisesOpError(r"Shape sizes do not match."):
              self.evaluate(
                  batch_reshape.BatchReshape(
                      distribution=mvn,
                      batch_shape=new_batch_shape_ph,
                      validate_args=True,
                  ).sample(seed=test_util.test_seed())
              )
  
imports: import numpy
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import bijector_test_util
  from tensorflow_probability.python.distributions import batch_reshape
  from tensorflow_probability.python.distributions import mvn_diag
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.distributions import poisson
  from tensorflow_probability.python.distributions import triangular
  from tensorflow_probability.python.distributions import uniform
  from tensorflow_probability.python.distributions import wishart
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.util.deferred_tensor import DeferredTensor
label_desc: Use image node_id 10 for calling the _BatchReshapeTest obj's underlying member method code with example usage: obj.test_bad_reshape_size() without return types