code: def testSamplePoissonInvalidRates(self):
      rate = [np.nan, -1.0, 0.0, 5.0, 7.0, 10.0, 13.0, 14.0, 15.0, 18.0]
      log_rate = np.log(rate)
      samples = self.evaluate(
          poisson_lib._random_poisson_noncpu(
              shape=[int(1e5)],
              log_rates=log_rate,
              output_dtype=tf.float64,
              seed=test_util.test_seed(),
          )
      )
      self.assertAllMeansClose(
          samples, stats.poisson.mean(rate), axis=0, rtol=0.01
      )
      self.assertAllClose(
          self.evaluate(tf.math.reduce_variance(samples, axis=0)),
          stats.poisson.var(rate),
          rtol=0.05,
      )
  
imports: import numpy
  from scipy import stats
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import poisson
  from tensorflow_probability.python.distributions.internal import statistical_testing
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import implementation_selection
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math import gradient
label_desc: Use image node_id 7 for calling the PoissonSamplingTest obj's underlying member method code with example usage: obj.testSamplePoissonInvalidRates() without return types