code: def testGeometricAtBoundary(self):
      geom = geometric.Geometric(probs=1.0, validate_args=True)
  
      x = np.array(
          [0.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0], dtype=np.float32
      )
      expected_log_prob = stats.geom.logpmf(x, [1.0], loc=-1)
      # Scipy incorrectly returns nan.
      expected_log_prob[np.isnan(expected_log_prob)] = 0.0
  
      log_prob = geom.log_prob(x)
      self.assertEqual(
          [
              7,
          ],
          log_prob.shape,
      )
      self.assertAllClose(expected_log_prob, self.evaluate(log_prob))
  
      pmf = geom.prob(x)
      self.assertEqual(
          [
              7,
          ],
          pmf.shape,
      )
      self.assertAllClose(np.exp(expected_log_prob), self.evaluate(pmf))
  
      expected_log_cdf = stats.geom.logcdf(x, 1.0, loc=-1)
  
      log_cdf = geom.log_cdf(x)
      self.assertEqual(
          [
              7,
          ],
          log_cdf.shape,
      )
      self.assertAllClose(expected_log_cdf, self.evaluate(log_cdf))
  
      cdf = geom.cdf(x)
      self.assertEqual(
          [
              7,
          ],
          cdf.shape,
      )
      self.assertAllClose(np.exp(expected_log_cdf), self.evaluate(cdf))
  
      expected_mean = stats.geom.mean(1.0, loc=-1)
      self.assertEqual([], geom.mean().shape)
      self.assertAllClose(expected_mean, self.evaluate(geom.mean()))
  
      expected_variance = stats.geom.var(1.0, loc=-1)
      self.assertEqual([], geom.variance().shape)
      self.assertAllClose(
          expected_variance, self.evaluate(geom.variance())
      )
  
      with self.assertRaisesOpError("Entropy is undefined"):
          self.evaluate(geom.entropy())
  
imports: import numpy
  from scipy import stats
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import geometric
  from tensorflow_probability.python.internal import test_util
label_desc: Use image node_id 15 for calling the GeometricTest obj's underlying member method code with example usage: obj.testGeometricAtBoundary() without return types