class_docstr: A mixture of a point-mass and another distribution.
  
  Under the hood, this is implemented as a mixture.Mixture, and so
  supports all of the methods of that class.
  
  ### Examples:
  
  ```python
  zinb = Inflated(
           tfd.NegativeBinomial(5.0, probs=0.1), inflated_loc_prob=0.2)
  sample = zinb.sample(seed=jax.random.PRNGKey(0))
  ```
docstr: Initialize the Inflated distribution.
  
  Args:
    distribution: The tfp.Distribution to combine with a point mass at x. This
      code is intended to be used only with discrete distributions; when used
      with continuous distributions sampling will work but log_probs will be a
      sum of values with different units.
    inflated_loc_logits: A scalar or tensor containing the excess log-odds for
      the point mass at inflated_loc.  Only one of `inflated_loc_probs` or
      `inflated_loc_logits` should be passed in.
    inflated_loc_probs: A scalar or tensor containing the mixture weights for
      the point mass at inflated_loc.  Only one of `inflated_loc_probs` or
      `inflated_loc_logits` should be passed in.
    inflated_loc: A scalar or tensor containing the locations of the point
      mass component of the mixture.
    inflated_loc_atol:  Non-negative `Tensor` of same `dtype` as
      `inflated_loc` and broadcastable shape.  The absolute tolerance for
      comparing closeness to `inflated_loc`.  Default is `0`.
    inflated_loc_rtol:  Non-negative `Tensor` of same `dtype` as
      `inflated_loc` and broadcastable shape.  The relative tolerance for
      comparing closeness to `inflated_loc`.  Default is `0`.
    validate_args: If true, inconsistent batch or event sizes raise a runtime
      error.
    allow_nan_stats: If false, any undefined statistics for any batch memeber
      raise an exception.
    name: An optional name for the distribution.
docstr_tok: ["Initialize","the","Inflated","distribution",".","Args",":","distribution",":","The","tfp.Distribution","to","combine","with","a","point","mass","at","x",".","This","code","is","intended","to","be","used","only","with","discrete","distributions",";","when","used","with","continuous","distributions","sampling","will","work","but","log_probs","will","be","a","sum","of","values","with","different","units",".","inflated_loc_logits",":","A","scalar","or","tensor","containing","the","excess","log-odds","for","the","point","mass","at","inflated_loc",".","Only","one","of","`","inflated_loc_probs","`","or","`","inflated_loc_logits","`","should","be","passed","in",".","inflated_loc_probs",":","A","scalar","or","tensor","containing","the","mixture","weights","for","the","point","mass","at","inflated_loc",".","Only","one","of","`","inflated_loc_probs","`","or","`","inflated_loc_logits","`","should","be","passed","in",".","inflated_loc",":","A","scalar","or","tensor","containing","the","locations","of","the","point","mass","component","of","the","mixture",".","inflated_loc_atol",":","Non-negative","`","Tensor","`","of","same","`","dtype","`","as","`","inflated_loc","`","and","broadcastable","shape",".","The","absolute","tolerance","for","comparing","closeness","to","`","inflated_loc","`",".","Default","is","`","0","`",".","inflated_loc_rtol",":","Non-negative","`","Tensor","`","of","same","`","dtype","`","as","`","inflated_loc","`","and","broadcastable","shape",".","The","relative","tolerance","for","comparing","closeness","to","`","inflated_loc","`",".","Default","is","`","0","`",".","validate_args",":","If","true",",","inconsistent","batch","or","event","sizes","raise","a","runtime","error",".","allow_nan_stats",":","If","false",",","any","undefined","statistics","for","any","batch","memeber","raise","an","exception",".","name",":","An","optional","name","for","the","distribution","."]
code: def __init__(
      self,
      distribution,
      inflated_loc_logits=None,
      inflated_loc_probs=None,
      inflated_loc=0.0,
      inflated_loc_atol=None,
      inflated_loc_rtol=None,
      validate_args=False,
      allow_nan_stats=True,
      name="Inflated",
  ):
      """Initialize the Inflated distribution.
  
      Args:
        distribution: The tfp.Distribution to combine with a point mass at x. This
          code is intended to be used only with discrete distributions; when used
          with continuous distributions sampling will work but log_probs will be a
          sum of values with different units.
        inflated_loc_logits: A scalar or tensor containing the excess log-odds for
          the point mass at inflated_loc.  Only one of `inflated_loc_probs` or
          `inflated_loc_logits` should be passed in.
        inflated_loc_probs: A scalar or tensor containing the mixture weights for
          the point mass at inflated_loc.  Only one of `inflated_loc_probs` or
          `inflated_loc_logits` should be passed in.
        inflated_loc: A scalar or tensor containing the locations of the point
          mass component of the mixture.
        inflated_loc_atol:  Non-negative `Tensor` of same `dtype` as
          `inflated_loc` and broadcastable shape.  The absolute tolerance for
          comparing closeness to `inflated_loc`.  Default is `0`.
        inflated_loc_rtol:  Non-negative `Tensor` of same `dtype` as
          `inflated_loc` and broadcastable shape.  The relative tolerance for
          comparing closeness to `inflated_loc`.  Default is `0`.
        validate_args: If true, inconsistent batch or event sizes raise a runtime
          error.
        allow_nan_stats: If false, any undefined statistics for any batch memeber
          raise an exception.
        name: An optional name for the distribution.
      """
      parameters = dict(locals())
      if (inflated_loc_logits is None) == (inflated_loc_probs is None):
          raise ValueError(
              "Must pass inflated_loc_logits or inflated_loc_probs, "
              "but not both."
          )
      if not isinstance(
          distribution, distribution_lib.DiscreteDistributionMixin
      ):
          warnings.warn(
              "You have created an Inflated distribution with "
              f"{distribution.name}, which is not discrete. "
          )
      with tf.name_scope(name) as name:
          dtype = dtype_util.common_dtype(
              [inflated_loc_logits, inflated_loc_probs, inflated_loc],
              dtype_hint=distribution.dtype,
          )
          self._distribution = distribution
          self._inflated_loc_logits = (
              tensor_util.convert_nonref_to_tensor(
                  inflated_loc_logits,
                  dtype=dtype,
                  name="inflated_loc_logits",
              )
          )
          self._inflated_loc_probs = (
              tensor_util.convert_nonref_to_tensor(
                  inflated_loc_probs,
                  dtype=dtype,
                  name="inflated_loc_probs",
              )
          )
          self._inflated_loc = tensor_util.convert_nonref_to_tensor(
              inflated_loc, dtype=dtype, name="inflated_loc"
          )
          self._inflated_loc_atol = (
              tensor_util.convert_nonref_to_tensor(
                  0 if inflated_loc_atol is None else inflated_loc_atol,
                  dtype=dtype,
                  name="inflated_loc_atol",
              )
          )
          self._inflated_loc_rtol = (
              tensor_util.convert_nonref_to_tensor(
                  0 if inflated_loc_rtol is None else inflated_loc_rtol,
                  dtype=dtype,
                  name="inflated_loc_rtol",
              )
          )
  
          if inflated_loc_probs is None:
              cat_logits = DeferredTensor(
                  self._inflated_loc_logits,
                  lambda logit: tf.stack([logit, -logit], axis=-1),
                  dtype=self._inflated_loc_logits.dtype,
                  shape=self._inflated_loc_logits.shape + (2,),
              )
              self._categorical_dist = categorical.Categorical(
                  logits=cat_logits,
                  validate_args=validate_args,
                  allow_nan_stats=allow_nan_stats,
              )
              probs_or_logits = self._inflated_loc_logits
          else:
              cat_probs = DeferredTensor(
                  self._inflated_loc_probs,
                  lambda probs: tf.stack(  # pylint: disable=g-long-lambda
                      [
                          probs,
                          tf.ones_like(probs, dtype=probs.dtype)
                          - probs,
                      ],
                      axis=-1,
                  ),
                  dtype=self._inflated_loc_probs.dtype,
                  shape=self._inflated_loc_probs.shape + (2,),
              )
              self._categorical_dist = categorical.Categorical(
                  probs=cat_probs,
                  validate_args=validate_args,
                  allow_nan_stats=allow_nan_stats,
              )
              probs_or_logits = self._inflated_loc_probs
  
          self._deterministic = deterministic.Deterministic(
              DeferredTensor(
                  probs_or_logits,
                  # pylint: disable=g-long-lambda
                  lambda _: tf.broadcast_to(
                      self._inflated_loc, ps.shape(probs_or_logits)
                  ),
                  shape=probs_or_logits.shape,
              ),
              atol=self._inflated_loc_atol,
              rtol=self._inflated_loc_rtol,
              validate_args=validate_args,
              allow_nan_stats=allow_nan_stats,
          )
  
          super(_Inflated, self).__init__(
              cat=self._categorical_dist,
              components=[self._deterministic, distribution],
              validate_args=validate_args,
              allow_nan_stats=allow_nan_stats,
              name=name,
          )
          self._parameters = parameters
  
imports: import inspect
  import warnings
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import sigmoid
  from tensorflow_probability.python.distributions import categorical
  from tensorflow_probability.python.distributions import deterministic
  from tensorflow_probability.python.distributions import distribution
  from tensorflow_probability.python.distributions import mixture
  from tensorflow_probability.python.distributions import negative_binomial
  from tensorflow_probability.python.internal import auto_composite_tensor
  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 samplers
  from tensorflow_probability.python.internal import tensor_util
  from tensorflow_probability.python.util.deferred_tensor import DeferredTensor
label_desc: Use image node_id 1 to create a new _Inflated object from inherited base classes: mixture with example: obj = _Inflated(distribution, inflated_loc_logits, inflated_loc_probs, inflated_loc, inflated_loc_atol, inflated_loc_rtol, validate_args, allow_nan_stats, name)