code: def test_kahan_precision(self, jit=False):
      maybe_jit = lambda f: f
      if jit:
          self.skip_if_no_xla()
          maybe_jit = tf.function(jit_compile=True)
      stream = test_util.test_seed_stream()
      n = 20_000
      samps = poisson.Poisson(rate=1.0).sample(n, seed=stream())
      log_rate = normal.Normal(0, 0.2).sample(seed=stream())
      pois = poisson.Poisson(log_rate=log_rate)
      lp = maybe_jit(
          sample.Sample(
              pois, n, experimental_use_kahan_sum=True
          ).log_prob
      )(samps)
      pois64 = poisson.Poisson(log_rate=tf.cast(log_rate, tf.float64))
      lp64 = sample.Sample(pois64, n).log_prob(
          tf.cast(samps, tf.float64)
      )
      # Evaluate together to ensure we use the same samples.
      lp, lp64 = self.evaluate((tf.cast(lp, tf.float64), lp64))
      # Fails 75% CPU, 0-80% GPU --vary_seed runs w/o experimental_use_kahan_sum.
      self.assertAllClose(lp64, lp, rtol=0.0, atol=0.02)
  
imports: import functools
  import os
  from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import exp
  from tensorflow_probability.python.bijectors import scale
  from tensorflow_probability.python.bijectors import scale_matvec_tril
  from tensorflow_probability.python.distributions import cholesky_lkj
  from tensorflow_probability.python.distributions import exponential
  from tensorflow_probability.python.distributions import independent
  from tensorflow_probability.python.distributions import kullback_leibler
  from tensorflow_probability.python.distributions import log_prob_ratio
  from tensorflow_probability.python.distributions import logistic
  from tensorflow_probability.python.distributions import lognormal
  from tensorflow_probability.python.distributions import mvn_diag
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.distributions import poisson
  from tensorflow_probability.python.distributions import sample
  from tensorflow_probability.python.distributions import transformed_distribution
  from tensorflow_probability.python.distributions import uniform
  from tensorflow_probability.python.internal import test_util
label_desc: Use image node_id 20 for calling the SampleDistributionTest obj's underlying member method code with example usage: obj.test_kahan_precision(jit) without return types