class_docstr: Geometric distribution.
  
  The Geometric distribution is parameterized by p, the probability of a
  positive event. It represents the probability that in k + 1 Bernoulli trials,
  the first k trials failed, before seeing a success.
  
  The pmf of this distribution is:
  
  #### Mathematical Details
  
  ```none
  pmf(k; p) = (1 - p)**k * p
  ```
  
  where:
  
  * `p` is the success probability, `0 < p <= 1`, and,
  * `k` is a non-negative integer.
class_docstr_tok: ["Geometric","distribution",".","The","Geometric","distribution","is","parameterized","by","p",",","the","probability","of","a","positive","event",".","It","represents","the","probability","that","in","k","+","1","Bernoulli","trials",",","the","first","k","trials","failed",",","before","seeing","a","success",".","The","pmf","of","this","distribution","is",":","#","#","#","#","Mathematical","Details","``","`","none","pmf","(","k",";","p",")","=","(","1","-","p",")","*","*","k","*","p","``","`","where",":","*","`","p","`","is","the","success","probability",",","`","0","<","p","<","=","1","`",",","and",",","*","`","k","`","is","a","non-negative","integer","."]
docstr: Construct Geometric distributions.
  
  Args:
    logits: Floating-point `Tensor` with shape `[B1, ..., Bb]` where `b >= 0`
      indicates the number of batch dimensions. Each entry represents logits
      for the probability of success for independent Geometric distributions
      and must be in the range `(-inf, inf]`. Only one of `logits` or `probs`
      should be specified.
    probs: Positive floating-point `Tensor` with shape `[B1, ..., Bb]`
      where `b >= 0` indicates the number of batch dimensions. Each entry
      represents the probability of success for independent Geometric
      distributions and must be in the range `(0, 1]`. Only one of `logits`
      or `probs` should be specified.
    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 Geometric pmf at integer
      values `k` but produces an unrestricted result on other inputs. In the
      case of Geometric distribution, the `log_prob` formula in this case
      happens to be the continuous function `k * log(1 - probs) + log(probs)`.
      Note that this function is not a normalized probability log-density.
      Default value: `False`.
    validate_args: Python `bool`, default `False`. When `True` distribution
      parameters are checked for validity despite possibly degrading runtime
      performance. When `False` invalid inputs may silently render incorrect
      outputs.
    allow_nan_stats: Python `bool`, default `True`. 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.
    name: Python `str` name prefixed to Ops created by this class.
docstr_tok: ["Construct","Geometric","distributions",".","Args",":","logits",":","Floating-point","`","Tensor","`","with","shape","`","[","B1",",","...",",","Bb","]","`","where","`","b",">","=","0","`","indicates","the","number","of","batch","dimensions",".","Each","entry","represents","logits","for","the","probability","of","success","for","independent","Geometric","distributions","and","must","be","in","the","range","`","(","-inf",",","inf","]","`",".","Only","one","of","`","logits","`","or","`","probs","`","should","be","specified",".","probs",":","Positive","floating-point","`","Tensor","`","with","shape","`","[","B1",",","...",",","Bb","]","`","where","`","b",">","=","0","`","indicates","the","number","of","batch","dimensions",".","Each","entry","represents","the","probability","of","success","for","independent","Geometric","distributions","and","must","be","in","the","range","`","(","0",",","1","]","`",".","Only","one","of","`","logits","`","or","`","probs","`","should","be","specified",".","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","Geometric","pmf","at","integer","values","`","k","`","but","produces","an","unrestricted","result","on","other","inputs",".","In","the","case","of","Geometric","distribution",",","the","`","log_prob","`","formula","in","this","case","happens","to","be","the","continuous","function","`","k","*","log","(","1","-","probs",")","+","log","(","probs",")","`",".","Note","that","this","function","is","not","a","normalized","probability","log-density",".","Default","value",":","`","False","`",".","validate_args",":","Python","`","bool","`",",","default","`","False","`",".","When","`","True","`","distribution","parameters","are","checked","for","validity","despite","possibly","degrading","runtime","performance",".","When","`","False","`","invalid","inputs","may","silently","render","incorrect","outputs",".","allow_nan_stats",":","Python","`","bool","`",",","default","`","True","`",".","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",".","name",":","Python","`","str","`","name","prefixed","to","Ops","created","by","this","class","."]
code: def __init__(
      self,
      logits=None,
      probs=None,
      force_probs_to_zero_outside_support=False,
      validate_args=False,
      allow_nan_stats=True,
      name="Geometric",
  ):
      """Construct Geometric distributions.
  
      Args:
        logits: Floating-point `Tensor` with shape `[B1, ..., Bb]` where `b >= 0`
          indicates the number of batch dimensions. Each entry represents logits
          for the probability of success for independent Geometric distributions
          and must be in the range `(-inf, inf]`. Only one of `logits` or `probs`
          should be specified.
        probs: Positive floating-point `Tensor` with shape `[B1, ..., Bb]`
          where `b >= 0` indicates the number of batch dimensions. Each entry
          represents the probability of success for independent Geometric
          distributions and must be in the range `(0, 1]`. Only one of `logits`
          or `probs` should be specified.
        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 Geometric pmf at integer
          values `k` but produces an unrestricted result on other inputs. In the
          case of Geometric distribution, the `log_prob` formula in this case
          happens to be the continuous function `k * log(1 - probs) + log(probs)`.
          Note that this function is not a normalized probability log-density.
          Default value: `False`.
        validate_args: Python `bool`, default `False`. When `True` distribution
          parameters are checked for validity despite possibly degrading runtime
          performance. When `False` invalid inputs may silently render incorrect
          outputs.
        allow_nan_stats: Python `bool`, default `True`. 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.
        name: Python `str` name prefixed to Ops created by this class.
      """
  
      parameters = dict(locals())
      if (probs is None) == (logits is None):
          raise ValueError("Must pass probs or logits, but not both.")
      with tf.name_scope(name) as name:
          dtype = dtype_util.common_dtype(
              [logits, probs], dtype_hint=tf.float32
          )
          self._probs = tensor_util.convert_nonref_to_tensor(
              probs, dtype=dtype, name="probs"
          )
          self._logits = tensor_util.convert_nonref_to_tensor(
              logits, dtype=dtype, name="logits"
          )
          self._force_probs_to_zero_outside_support = (
              force_probs_to_zero_outside_support
          )
          super(Geometric, 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 softmax_centered
  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 samplers
  from tensorflow_probability.python.internal import tensor_util
  from tensorflow_probability.python.math import generic
label_desc: Use image node_id 1 to create a new Geometric object from inherited base classes: distribution, distribution with example: obj = Geometric(logits, probs, force_probs_to_zero_outside_support, validate_args, allow_nan_stats, name)