class_docstr: Continuous Bernoulli distribution.
  
  This distribution is parameterized by `probs`, a (batch of) parameters
  taking values in `(0, 1)`. Note that, unlike in the Bernoulli case, `probs`
  does not correspond to a probability, but the same name is used due to the
  similarity with the Bernoulli.
  
  #### Mathematical Details
  
  The continuous Bernoulli is a distribution over the interval `[0, 1]`,
  parameterized by `probs` in `(0, 1)`.
  
  The probability density function (pdf) is,
  
  ```none
  pdf(x; probs) = probs**x * (1 - probs)**(1 - x) * C(probs)
  C(probs) = (2 * atanh(1 - 2 * probs) / (1 - 2 * probs) if probs != 0.5
              else 2.)
  ```
  
  While the normalizing constant `C(probs)` is a continuous function of `probs`
  (even at `probs = 0.5`), computing it at values close to 0.5 can result in
  numerical instabilities due to 0/0 errors. A Taylor approximation of
  `C(probs)` is thus used for values of `probs`
  in a small interval around 0.5.
  
  NOTE: Unlike the Bernoulli, numerical instabilities can happen for `probs`
  very close to 0 or 1. Current implementation allows any value in `(0, 1)`,
  but this could be changed to `(1e-6, 1-1e-6)` to avoid these issues.
  
  #### References
  
  [1] Loaiza-Ganem G and Cunningham JP. The continuous Bernoulli: fixing a
      pervasive error in variational autoencoders. NeurIPS2019.
      https://arxiv.org/abs/1907.06845
code: def _quantile(self, p, logits=None):
      if logits is None:
          logits = self._logits_parameter_no_checks()
      logp = tf.math.log(p)
      # The expression for the quantile function is:
      # log(1 + (e^s - 1) * p) / s, where s is `logits`. When s is large,
      # the e^s sub-term becomes increasingly ill-conditioned.  However,
      # since the numerator tends to s, we can reformulate the s > 0 case
      # as a offset from 1, which is more accurate.  Coincidentally,
      # this eliminates a ratio of infinities problem when `s == +inf`.
  
      safe_negative_logits = tf.where(logits < 0.0, logits, -1.0)
      safe_positive_logits = tf.where(logits > 0.0, logits, 1.0)
      result = tf.where(
          logits > 0.0,
          1.0
          + generic.log_add_exp(
              logp + generic.log1mexp(safe_positive_logits),
              tf.math.negative(safe_positive_logits),
          )
          / safe_positive_logits,
          tf.math.log1p(tf.math.expm1(safe_negative_logits) * p)
          / safe_negative_logits,
      )
  
      # When logits is zero, we can simplify
      # log(1 + (e^s - 1) * p) / s ~= log(1 + s * p) / s ~= s * p / s = p
      # Specifically, when logits is zero, the naive computation produces a NaN.
      result = tf.where(tf.math.equal(logits, 0.0), p, result)
  
      # Finally, handle the case where `logits` and `p` are on the boundary,
      # as the above expressions can result in ratio of `infs` in that case as
      # well.
      return tf.where(
          (tf.math.equal(logits, -np.inf) & tf.math.equal(logp, 0.0))
          | (tf.math.equal(logits, np.inf) & tf.math.is_inf(logp)),
          tf.ones_like(logits),
          result,
      )
  
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import sigmoid
  from tensorflow_probability.python.distributions import distribution
  from tensorflow_probability.python.distributions import kullback_leibler
  from tensorflow_probability.python.internal import assert_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 samplers
  from tensorflow_probability.python.internal import tensor_util
  from tensorflow_probability.python.math import generic
label_desc: Use image node_id 15 for calling the ContinuousBernoulli obj's underlying member method code with example usage: obj._quantile(p, logits) and returns: tf