class_docstr: Base class for continuous entropy models.
  
  The basic functionality of this class is to pre-compute integer probability
  tables based on the provided `tfp.distributions.Distribution` object, which
  can then be used reliably across different platforms by the range coder and
  decoder.
class_docstr_tok: ["Base","class","for","continuous","entropy","models",".","The","basic","functionality","of","this","class","is","to","pre-compute","integer","probability","tables","based","on","the","provided","`","tfp.distributions.Distribution","`","object",",","which","can","then","be","used","reliably","across","different","platforms","by","the","range","coder","and","decoder","."]
docstr: Evaluates prior.log_prob(bottleneck + noise).
docstr_tok: ["Evaluates","prior.log_prob","(","bottleneck","+","noise",")","."]
code: def _log_prob(self, prior, bottleneck_perturbed):
      """Evaluates prior.log_prob(bottleneck + noise)."""
      bottleneck_perturbed = tf.cast(bottleneck_perturbed, prior.dtype)
      laplace_tail_mass = self.laplace_tail_mass
  
      def mixture_log_prob_fn():
          with tf.control_dependencies(
              [
                  tf.debugging.assert_less(
                      laplace_tail_mass,
                      tf.constant(1.0, prior.dtype),
                      message="`laplace_tail_mass` must be less than 1.",
                  )
              ]
          ):
              laplace_prior = uniform_noise.NoisyLaplace(
                  loc=tf.constant(0, dtype=prior.dtype),
                  scale=tf.constant(1, dtype=prior.dtype),
              )
              probs = prior.prob(bottleneck_perturbed)
              probs = (
                  1 - laplace_tail_mass
              ) * probs + laplace_tail_mass * laplace_prior.prob(
                  bottleneck_perturbed
              )
          probs_too_small = probs < 1e-10
          probs_bounded = tf.maximum(probs, 1e-10)
          return tf.where(
              probs_too_small,
              tf.math.log(laplace_tail_mass)
              + laplace_prior.log_prob(bottleneck_perturbed),
              tf.math.log(probs_bounded),
          )
  
      prior_log_prob_fn = lambda: prior.log_prob(bottleneck_perturbed)
  
      if isinstance(laplace_tail_mass, tf.Tensor):
          # Do all the computation in tf (graph mode compatible).
          laplace_tail_mass = tf.cast(laplace_tail_mass, prior.dtype)
          use_laplace_tail_mass = tf.greater(laplace_tail_mass, 0.0)
          return tf.cond(
              use_laplace_tail_mass,
              mixture_log_prob_fn,
              prior_log_prob_fn,
          )
      else:
          if laplace_tail_mass > 0:
              return mixture_log_prob_fn()
          else:
              return prior_log_prob_fn()
  
imports: import abc
  from absl import logging
  import tensorflow
  from tensorflow_compression.python.distributions import helpers
  from tensorflow_compression.python.distributions import uniform_noise
  from tensorflow_compression.python.ops import gen_ops
label_desc: Use image node_id 17 for calling the ContinuousEntropyModelBase obj's underlying member method code with example usage: obj._log_prob(prior, bottleneck_perturbed) and returns: tf, tf, mixture_log_prob_fn, prior_log_prob_fn