class_docstr: Poisson distribution.
  
  The Poisson distribution is parameterized by an event `rate` parameter.
  
  #### Mathematical Details
  
  The probability mass function (pmf) is,
  
  ```none
  pmf(k; lambda, k >= 0) = (lambda^k / k!) / Z
  Z = exp(lambda).
  ```
  
  where `rate = lambda` and `Z` is the normalizing constant.
class_docstr_tok: ["Poisson","distribution",".","The","Poisson","distribution","is","parameterized","by","an","event","`","rate","`","parameter",".","#","#","#","#","Mathematical","Details","The","probability","mass","function","(","pmf",")","is",",","``","`","none","pmf","(","k",";","lambda",",","k",">","=","0",")","=","(","lambda^k","\/","k","!",")","\/","Z","Z","=","exp","(","lambda",")",".","``","`","where","`","rate","=","lambda","`","and","`","Z","`","is","the","normalizing","constant","."]
docstr: Initialize a batch of Poisson distributions.
  
  Args:
    rate: Floating point tensor, the rate parameter. `rate` must be positive.
      Must specify exactly one of `rate` and `log_rate`.
    log_rate: Floating point tensor, the log of the rate parameter.
      Must specify exactly one of `rate` and `log_rate`.
    force_probs_to_zero_outside_support: Python `bool`. When `True`, negative
      and non-integer values are evaluated "strictly": `log_prob` returns
      `-inf`, `prob` returns `0`, and `cdf` and `sf` correspond.  When
      `False`, the implementation is free to save computation (and TF graph
      size) by evaluating something that matches the Poisson pmf at integer
      values `k` but produces an unrestricted result on other inputs.  In the
      case of Poisson, the `log_prob` formula in this case happens to be the
      continuous function `k * log_rate - lgamma(k+1) - rate`.  Note that this
      function is not itself a normalized probability log-density.
      Default value: `False`.
    validate_args: Python `bool`. When `True` distribution
      parameters are checked for validity despite possibly degrading runtime
      performance. When `False` invalid inputs may silently render incorrect
      outputs.
      Default value: `False`.
    allow_nan_stats: Python `bool`. When `True`, statistics
      (e.g., mean, mode, variance) use the value "`NaN`" to indicate the
      result is undefined. When `False`, an exception is raised if one or
      more of the statistic's batch members are undefined.
      Default value: `True`.
    name: Python `str` name prefixed to Ops created by this class.
  
  Raises:
    ValueError: if none or both of `rate`, `log_rate` are specified.
    TypeError: if `rate` is not a float-type.
    TypeError: if `log_rate` is not a float-type.
docstr_tok: ["Initialize","a","batch","of","Poisson","distributions",".","Args",":","rate",":","Floating","point","tensor",",","the","rate","parameter",".","`","rate","`","must","be","positive",".","Must","specify","exactly","one","of","`","rate","`","and","`","log_rate","`",".","log_rate",":","Floating","point","tensor",",","the","log","of","the","rate","parameter",".","Must","specify","exactly","one","of","`","rate","`","and","`","log_rate","`",".","force_probs_to_zero_outside_support",":","Python","`","bool","`",".","When","`","True","`",",","negative","and","non-integer","values","are","evaluated","``","strictly","''",":","`","log_prob","`","returns","`","-inf","`",",","`","prob","`","returns","`","0","`",",","and","`","cdf","`","and","`","sf","`","correspond",".","When","`","False","`",",","the","implementation","is","free","to","save","computation","(","and","TF","graph","size",")","by","evaluating","something","that","matches","the","Poisson","pmf","at","integer","values","`","k","`","but","produces","an","unrestricted","result","on","other","inputs",".","In","the","case","of","Poisson",",","the","`","log_prob","`","formula","in","this","case","happens","to","be","the","continuous","function","`","k","*","log_rate","-","lgamma","(","k+1",")","-","rate","`",".","Note","that","this","function","is","not","itself","a","normalized","probability","log-density",".","Default","value",":","`","False","`",".","validate_args",":","Python","`","bool","`",".","When","`","True","`","distribution","parameters","are","checked","for","validity","despite","possibly","degrading","runtime","performance",".","When","`","False","`","invalid","inputs","may","silently","render","incorrect","outputs",".","Default","value",":","`","False","`",".","allow_nan_stats",":","Python","`","bool","`",".","When","`","True","`",",","statistics","(","e.g.",",","mean",",","mode",",","variance",")","use","the","value","``","`","NaN","`","``","to","indicate","the","result","is","undefined",".","When","`","False","`",",","an","exception","is","raised","if","one","or","more","of","the","statistic","'s","batch","members","are","undefined",".","Default","value",":","`","True","`",".","name",":","Python","`","str","`","name","prefixed","to","Ops","created","by","this","class",".","Raises",":","ValueError",":","if","none","or","both","of","`","rate","`",",","`","log_rate","`","are","specified",".","TypeError",":","if","`","rate","`","is","not","a","float-type",".","TypeError",":","if","`","log_rate","`","is","not","a","float-type","."]
code: def __init__(
      self,
      rate=None,
      log_rate=None,
      force_probs_to_zero_outside_support=False,
      validate_args=False,
      allow_nan_stats=True,
      name="Poisson",
  ):
      """Initialize a batch of Poisson distributions.
  
      Args:
        rate: Floating point tensor, the rate parameter. `rate` must be positive.
          Must specify exactly one of `rate` and `log_rate`.
        log_rate: Floating point tensor, the log of the rate parameter.
          Must specify exactly one of `rate` and `log_rate`.
        force_probs_to_zero_outside_support: Python `bool`. When `True`, negative
          and non-integer values are evaluated "strictly": `log_prob` returns
          `-inf`, `prob` returns `0`, and `cdf` and `sf` correspond.  When
          `False`, the implementation is free to save computation (and TF graph
          size) by evaluating something that matches the Poisson pmf at integer
          values `k` but produces an unrestricted result on other inputs.  In the
          case of Poisson, the `log_prob` formula in this case happens to be the
          continuous function `k * log_rate - lgamma(k+1) - rate`.  Note that this
          function is not itself a normalized probability log-density.
          Default value: `False`.
        validate_args: Python `bool`. When `True` distribution
          parameters are checked for validity despite possibly degrading runtime
          performance. When `False` invalid inputs may silently render incorrect
          outputs.
          Default value: `False`.
        allow_nan_stats: Python `bool`. When `True`, statistics
          (e.g., mean, mode, variance) use the value "`NaN`" to indicate the
          result is undefined. When `False`, an exception is raised if one or
          more of the statistic's batch members are undefined.
          Default value: `True`.
        name: Python `str` name prefixed to Ops created by this class.
  
      Raises:
        ValueError: if none or both of `rate`, `log_rate` are specified.
        TypeError: if `rate` is not a float-type.
        TypeError: if `log_rate` is not a float-type.
      """
      parameters = dict(locals())
      if (rate is None) == (log_rate is None):
          raise ValueError(
              "Must specify exactly one of `rate` and `log_rate`."
          )
      with tf.name_scope(name) as name:
          dtype = dtype_util.common_dtype(
              [rate, log_rate], dtype_hint=tf.float32
          )
          if not dtype_util.is_floating(dtype):
              raise TypeError(
                  "[log_]rate.dtype ({}) is a not a float-type.".format(
                      dtype_util.name(dtype)
                  )
              )
          self._rate = tensor_util.convert_nonref_to_tensor(
              rate, name="rate", dtype=dtype
          )
          self._log_rate = tensor_util.convert_nonref_to_tensor(
              log_rate, name="log_rate", dtype=dtype
          )
          self._force_probs_to_zero_outside_support = (
              force_probs_to_zero_outside_support
          )
  
          super(Poisson, self).__init__(
              dtype=dtype,
              reparameterization_type=reparameterization.NOT_REPARAMETERIZED,
              validate_args=validate_args,
              allow_nan_stats=allow_nan_stats,
              parameters=parameters,
              name=name,
          )
  
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import softplus
  from tensorflow_probability.python.distributions import distribution
  from tensorflow_probability.python.internal import assert_util
  from tensorflow_probability.python.internal import batched_rejection_sampler
  from tensorflow_probability.python.internal import distribution_util
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import implementation_selection
  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
label_desc: Use image node_id 1 to create a new Poisson object from inherited base classes: distribution, distribution with example: obj = Poisson(rate, log_rate, force_probs_to_zero_outside_support, validate_args, allow_nan_stats, name)