code: def test_error_when_transition_modifies_batch_shape(self):
      loses_batch_shape = markov_chain_lib.MarkovChain(
          initial_state_prior=normal.Normal(loc=0.0, scale=[1.0, 1.0]),
          transition_fn=lambda _, x: independent.Independent(  # pylint: disable=g-long-lambda
              normal.Normal(loc=0.0, scale=tf.ones_like(x)),
              reinterpreted_batch_ndims=1,
          ),
          num_steps=5,
      )
      x = self.evaluate(
          loses_batch_shape.sample([2], seed=test_util.test_seed())
      )
      with self.assertRaisesRegexp(
          ValueError, "batch shape is incorrect"
      ):
          loses_batch_shape.log_prob(x)
  
      gains_batch_shape = markov_chain_lib.MarkovChain(
          initial_state_prior=independent.Independent(
              normal.Normal(loc=0.0, scale=[1.0, 1.0]),
              reinterpreted_batch_ndims=1,
          ),
          transition_fn=lambda _, x: normal.Normal(
              loc=0.0, scale=tf.ones_like(x)
          ),
          num_steps=5,
      )
      x = self.evaluate(
          gains_batch_shape.sample([2], seed=test_util.test_seed())
      )
      with self.assertRaisesRegexp(
          ValueError, "batch shape is incorrect"
      ):
          gains_batch_shape.log_prob(x)
  
imports: from absl.testing import parameterized
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import reshape
  from tensorflow_probability.python.bijectors import split
  from tensorflow_probability.python.distributions import deterministic
  from tensorflow_probability.python.distributions import dirichlet
  from tensorflow_probability.python.distributions import exponential
  from tensorflow_probability.python.distributions import gamma
  from tensorflow_probability.python.distributions import independent
  from tensorflow_probability.python.distributions import inverse_gamma
  from tensorflow_probability.python.distributions import joint_distribution_auto_batched
  from tensorflow_probability.python.distributions import joint_distribution_named
  from tensorflow_probability.python.distributions import linear_gaussian_ssm
  from tensorflow_probability.python.distributions import log_prob_ratio
  from tensorflow_probability.python.distributions import markov_chain
  from tensorflow_probability.python.distributions import mvn_diag
  from tensorflow_probability.python.distributions import mvn_tril
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.distributions import uniform
  from tensorflow_probability.python.distributions import wishart
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import samplers
  from tensorflow_probability.python.internal import test_util
label_desc: Use image node_id 1 for calling the MarkovChainTest obj's underlying member method code with example usage: obj.test_error_when_transition_modifies_batch_shape() without return types