class_docstr: The finite discrete distribution.
  
  The FiniteDiscrete distribution is parameterized by either probabilities or
  log-probabilities of a set of `K` possible outcomes, which is defined by
  a strictly ascending list of `K` values.
  
  Note: log_prob, prob, cdf, mode, and entropy are differentiable with respect
  to `logits` or `probs` but not with respect to `outcomes`.
  
  #### Mathematical Details
  
  The probability mass function (pmf) is,
  
  ```none
  pmf(x; pi, qi) = prod_j pi_j**[x == qi_j]
  ```
  
  #### Examples
  
  ```python
  
  # Initialize a discrete distribution with 4 possible outcomes and the 2nd
  # outcome being most likely.
  dist = FiniteDiscrete([1., 2., 4., 8.], probs=[0.1, 0.4, 0.3, 0.2])
  dist.prob(2.)
  # ==> 0.4
  
  # Using logits to initialize a discrete distribution with 4 possible outcomes
  # and the 2nd outcome being most likely.
  dist = FiniteDiscrete([1., 2., 4., 8.], logits=np.log([0.1, 0.4, 0.3, 0.2]))
  dist.prob(2.)
  # ==> 0.4
  ```
code: def _cdf(self, x):
      x = tf.convert_to_tensor(x, name="x")
      flat_x = tf.reshape(x, shape=[-1])
      upper_bound = tf.searchsorted(
          self.outcomes, values=flat_x, side="right"
      )
      values_at_ub = tf.gather(
          self.outcomes,
          indices=tf.minimum(
              upper_bound, ps.shape(self.outcomes)[-1] - 1
          ),
      )
      should_use_upper_bound = self._is_equal_or_close(
          flat_x, values_at_ub
      )
      indices = tf.where(
          should_use_upper_bound, upper_bound, upper_bound - 1
      )
      indices = tf.reshape(
          indices, shape=dist_util.prefer_static_shape(x)
      )
      indices_non_negative = tf.where(
          tf.equal(indices, -1), tf.zeros([], indices.dtype), indices
      )
      cdf = self._categorical.cdf(indices_non_negative)
      return tf.where(
          tf.equal(indices, -1), tf.zeros([], cdf.dtype), cdf
      )
  
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import ascending
  from tensorflow_probability.python.bijectors import softmax_centered
  from tensorflow_probability.python.bijectors import softplus
  from tensorflow_probability.python.distributions import categorical
  from tensorflow_probability.python.distributions import distribution
  from tensorflow_probability.python.internal import assert_util
  from tensorflow_probability.python.internal import distribution_util
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import parameter_properties
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import reparameterization
  from tensorflow_probability.python.internal import tensor_util
  from tensorflow_probability.python.internal import tensorshape_util
label_desc: Use image node_id 8 for calling the FiniteDiscrete obj's underlying member method code with example usage: obj._cdf(x) and returns: tf