code: def testCdfAgreesWithLogProb(self):
      # Shape [N, 1, 1, 1]. This is to support broadcasting and the last dimension
      # for evaluating against the quadrature nodes.
  
      # Choose probs in a modest range such that the density isn't extremeely
      # skewed for quadrature.
      probs = tf.random.uniform(
          minval=0.3,
          maxval=0.7,
          shape=[int(1e2)],
          dtype=np.float64,
          seed=test_util.test_seed(),
      )[..., tf.newaxis, tf.newaxis, tf.newaxis]
      temp = np.array([0.5, 1.0, 2.0], dtype=np.float64)[
          ..., np.newaxis, np.newaxis
      ]
      dist = relaxed_bernoulli.RelaxedBernoulli(
          temp, probs=probs, validate_args=True
      )
  
      x = np.array([0.1, 0.25, 0.5, 0.75, 0.9], dtype=np.float64)
      # Do quadrature on the probability density from 0 to x.
      nodes, weights = scipy.special.roots_legendre(500)
      rescaled_nodes = x[..., np.newaxis] / 2.0 * (nodes + 1.0)
      expected_log_cdf = (
          tf.math.log(x / 2.0)
          + tf.math.reduce_logsumexp(
              np.log(weights) + dist.log_prob(rescaled_nodes), axis=-1
          )
      )[..., tf.newaxis, :]
      actual_log_cdf, expected_log_cdf = self.evaluate(
          [dist.log_cdf(x), expected_log_cdf]
      )
      self.assertAllClose(expected_log_cdf, actual_log_cdf, rtol=2e-2)
  
imports: import numpy
  import scipy.special
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import relaxed_bernoulli
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.internal import test_util
label_desc: Use image node_id 16 for calling the RelaxedBernoulliTest obj's underlying member method code with example usage: obj.testCdfAgreesWithLogProb() without return types