code: def test_shapes_match_proposal_distribution(self):
      target = mvn_tril.MultivariateNormalTriL(
          loc=[-2.0, 1.0], scale_tril=[[1.0, 0.0], [-3.0, 2.0]]
      )
      # Proposal with batch shape.
      proposal = independent.Independent(
          student_t.StudentT(
              df=2, loc=0.0, scale=[[5.0, 2.0], [1.0, 3.0]]
          ),
          reinterpreted_batch_ndims=1,
      )
  
      seed = test_util.test_seed(sampler_type="stateless")
      resampled = importance_resample.ImportanceResample(
          proposal,
          target_log_prob_fn=target.log_prob,
          importance_sample_size=10,
          stochastic_approximation_seed=seed,
      )
      self.assertAllEqual(resampled.event_shape, proposal.event_shape)
      self.assertAllEqual(
          resampled.event_shape_tensor(), proposal.event_shape_tensor()
      )
      self.assertAllEqual(resampled.batch_shape, proposal.batch_shape)
      self.assertAllEqual(
          resampled.batch_shape_tensor(), proposal.batch_shape_tensor()
      )
  
      self.assertAllEqual(
          resampled.sample(7, seed=seed).shape,
          proposal.sample(7, seed=seed).shape,
      )
  
      xs = tf.range(2, dtype=proposal.dtype)
      self.assertAllEqual(
          resampled.log_prob(xs).shape, proposal.log_prob(xs).shape
      )
  
imports: from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import categorical
  from tensorflow_probability.python.distributions import independent
  from tensorflow_probability.python.distributions import joint_distribution_coroutine
  from tensorflow_probability.python.distributions import mixture_same_family
  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 student_t
  from tensorflow_probability.python.experimental.distributions import importance_resample
  from tensorflow_probability.python.internal import samplers
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.vi import csiszar_divergence
label_desc: Use image node_id 1 for calling the ImportanceResampleTest obj's underlying member method code with example usage: obj.test_shapes_match_proposal_distribution() without return types