code: def test_resample_using_extremal_log_points(self):
      if self.use_xla and tf.executing_eagerly():
          self.skipTest(
              "No need to test XLA under all execution regimes."
          )
  
      n = 8
  
      one = self.dtype(1)
      almost_one = np.nextafter(one, self.dtype(0))
      sample_shape = []
      log_points_zero = tf.math.log(tf.zeros(n, self.dtype))
      log_points_almost_one = tf.fill([n], tf.math.log(almost_one))
      log_probs_beginning = tf.math.log(
          tf.concat([[one], tf.zeros(n - 1, dtype=self.dtype)], axis=0)
      )
      log_probs_end = tf.math.log(
          tf.concat([tf.zeros(n - 1, dtype=self.dtype), [one]], axis=0)
      )
  
      sample_fn = self.maybe_compiler(_resample_using_log_points)
      indices = sample_fn(
          log_probs_beginning, sample_shape, log_points_zero
      )
      self.assertAllEqual(indices, tf.zeros(n, dtype=tf.float32))
  
      indices = sample_fn(log_probs_end, sample_shape, log_points_zero)
      self.assertAllEqual(indices, tf.fill([n], n - 1))
  
      indices = sample_fn(
          log_probs_beginning, sample_shape, log_points_almost_one
      )
      self.assertAllEqual(indices, tf.zeros(n, dtype=tf.float32))
  
      indices = sample_fn(
          log_probs_end, sample_shape, log_points_almost_one
      )
      self.assertAllEqual(indices, tf.fill([n], n - 1))
  
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import chi2
  from tensorflow_probability.python.distributions import poisson
  from tensorflow_probability.python.distributions import uniform
  from tensorflow_probability.python.experimental.mcmc.weighted_resampling import _resample_using_log_points
  from tensorflow_probability.python.experimental.mcmc.weighted_resampling import _scatter_nd_batch
  from tensorflow_probability.python.experimental.mcmc.weighted_resampling import resample
  from tensorflow_probability.python.experimental.mcmc.weighted_resampling import resample_deterministic_minimum_error
  from tensorflow_probability.python.experimental.mcmc.weighted_resampling import resample_independent
  from tensorflow_probability.python.experimental.mcmc.weighted_resampling import resample_stratified
  from tensorflow_probability.python.experimental.mcmc.weighted_resampling import resample_systematic
  from tensorflow_probability.python.internal import distribution_util
  from tensorflow_probability.python.internal import test_util
label_desc: Use image node_id 9 for calling the _SMCResamplersTest obj's underlying member method code with example usage: obj.test_resample_using_extremal_log_points() without return types