code: def test_slice_transformed_distribution_with_chain(self):
      dist = transformed_distribution.TransformedDistribution(
          distribution=mvn_diag.MultivariateNormalDiag(
              loc=tf.zeros([4]), scale_diag=tf.ones([1, 4])
          ),
          bijector=chain.Chain(
              [
                  joint_map.JointMap(
                      [
                          identity.Identity(),
                          shift.Shift(tf.ones([4, 3, 2])),
                      ]
                  ),
                  split.Split(2),
                  scale_matvec_diag.ScaleMatvecDiag(
                      tf.ones([5, 1, 3, 4])
                  ),
                  exp.Exp(),
              ]
          ),
      )
      self.assertAllEqual(dist.batch_shape_tensor(), [5, 4, 3])
      self.assertAllEqualNested(
          tf.nest.map_structure(
              lambda x: x.shape, dist.sample(seed=test_util.test_seed())
          ),
          [[5, 4, 3, 2], [5, 4, 3, 2]],
      )
  
      sliced = dist[tf.newaxis, ..., 0, :, :-1]
      self.assertAllEqual(sliced.batch_shape_tensor(), [1, 4, 2])
      self.assertAllEqualNested(
          tf.nest.map_structure(
              lambda x: x.shape,
              sliced.sample(seed=test_util.test_seed()),
          ),
          [[1, 4, 2, 2], [1, 4, 2, 2]],
      )
  
imports: import numpy
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import chain
  from tensorflow_probability.python.bijectors import exp
  from tensorflow_probability.python.bijectors import identity
  from tensorflow_probability.python.bijectors import invert
  from tensorflow_probability.python.bijectors import joint_map
  from tensorflow_probability.python.bijectors import scale
  from tensorflow_probability.python.bijectors import scale_matvec_diag
  from tensorflow_probability.python.bijectors import shift
  from tensorflow_probability.python.bijectors import split
  from tensorflow_probability.python.distributions import bernoulli
  from tensorflow_probability.python.distributions import categorical
  from tensorflow_probability.python.distributions import exponential
  from tensorflow_probability.python.distributions import mixture_same_family
  from tensorflow_probability.python.distributions import mvn_diag
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.distributions import transformed_distribution
  from tensorflow_probability.python.internal import slicing
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.internal import test_util
label_desc: Use image node_id 21 for calling the SlicingTest obj's underlying member method code with example usage: obj.test_slice_transformed_distribution_with_chain() without return types