code: def test_sample_size_one_reproduces_proposal_distribution(self):
      target = normal.Normal(loc=0.0, scale=1.0)
      proposal = normal.Normal(loc=-4.0, scale=5.0)
      resampled = importance_resample.ImportanceResample(
          proposal,
          target_log_prob_fn=target.log_prob,
          importance_sample_size=1,
      )
      xs = self.evaluate(
          resampled.sample(
              10000, seed=test_util.test_seed(sampler_type="stateless")
          )
      )
      # Check that samples have statistics matching the proposal distribution.
      self.assertAllClose(tf.reduce_mean(xs), proposal.mean(), atol=0.1)
      self.assertAllClose(
          tf.math.reduce_std(xs), proposal.stddev(), atol=0.1
      )
      # Log probs should also match up to numerics.
      self.assertAllClose(
          resampled.log_prob(xs), proposal.log_prob(xs), rtol=1e-4
      )
  
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 2 for calling the ImportanceResampleTest obj's underlying member method code with example usage: obj.test_sample_size_one_reproduces_proposal_distribution() without return types