class_docstr: Zipf distribution.
  
  The Zipf distribution is parameterized by a `power` parameter.
  
  #### Mathematical Details
  
  The probability mass function (pmf) is,
  
  ```none
  pmf(k; alpha, k >= 0) = (k^(-alpha)) / Z
  Z = zeta(alpha).
  ```
  
  where `power = alpha` and Z is the normalization constant.
  `zeta` is the [Riemann zeta function](
  https://en.wikipedia.org/wiki/Riemann_zeta_function).
  
  Note that gradients with respect to the `power` parameter are not
  supported in the current implementation.
class_docstr_tok: ["Zipf","distribution",".","The","Zipf","distribution","is","parameterized","by","a","`","power","`","parameter",".","#","#","#","#","Mathematical","Details","The","probability","mass","function","(","pmf",")","is",",","``","`","none","pmf","(","k",";","alpha",",","k",">","=","0",")","=","(","k^","(","-alpha",")",")","\/","Z","Z","=","zeta","(","alpha",")",".","``","`","where","`","power","=","alpha","`","and","Z","is","the","normalization","constant",".","`","zeta","`","is","the","[","Riemann","zeta","function","]","(","https",":","\/\/en.wikipedia.org\/wiki\/Riemann_zeta_function",")",".","Note","that","gradients","with","respect","to","the","`","power","`","parameter","are","not","supported","in","the","current","implementation","."]
docstr: Initialize a batch of Zipf distributions.
  
  Args:
    power: `Float` like `Tensor` representing the power parameter. Must be
      strictly greater than `1`.
    dtype: The `dtype` of `Tensor` returned by `sample`.
      Default value: `tf.int32`.
    force_probs_to_zero_outside_support: Python `bool`. When `True`,
      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 Zipf pmf at integer
      values `k` but produces an unrestricted result on other inputs.  In the
      case of Zipf, the `log_prob` formula in this case happens to be the
      continuous function `-power log(k) - log(zeta(power))`.  Note that this
      function is not itself a normalized probability log-density.
      Default value: `False`.
    sample_maximum_iterations: Maximum number of iterations of allowable
      iterations in `sample`. When `validate_args=True`, samples which fail to
      reach convergence (subject to this cap) are masked out with
      `self.dtype.min` or `nan` depending on `self.dtype.is_integer`.
      Default value: `100`.
    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.
      Default value: `False`.
    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.
      Default value: `False`.
    name: Python `str` name prefixed to Ops created by this class.
      Default value: `'Zipf'`.
  
  Raises:
    TypeError: if `power` is not `float` like.
docstr_tok: ["Initialize","a","batch","of","Zipf","distributions",".","Args",":","power",":","`","Float","`","like","`","Tensor","`","representing","the","power","parameter",".","Must","be","strictly","greater","than","`","1","`",".","dtype",":","The","`","dtype","`","of","`","Tensor","`","returned","by","`","sample","`",".","Default","value",":","`","tf.int32","`",".","force_probs_to_zero_outside_support",":","Python","`","bool","`",".","When","`","True","`",",","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","Zipf","pmf","at","integer","values","`","k","`","but","produces","an","unrestricted","result","on","other","inputs",".","In","the","case","of","Zipf",",","the","`","log_prob","`","formula","in","this","case","happens","to","be","the","continuous","function","`","-power","log","(","k",")","-","log","(","zeta","(","power",")",")","`",".","Note","that","this","function","is","not","itself","a","normalized","probability","log-density",".","Default","value",":","`","False","`",".","sample_maximum_iterations",":","Maximum","number","of","iterations","of","allowable","iterations","in","`","sample","`",".","When","`","validate_args=True","`",",","samples","which","fail","to","reach","convergence","(","subject","to","this","cap",")","are","masked","out","with","`","self.dtype.min","`","or","`","nan","`","depending","on","`","self.dtype.is_integer","`",".","Default","value",":","`","100","`",".","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",".","Default","value",":","`","False","`",".","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",".","Default","value",":","`","False","`",".","name",":","Python","`","str","`","name","prefixed","to","Ops","created","by","this","class",".","Default","value",":","`","'Zipf","'","`",".","Raises",":","TypeError",":","if","`","power","`","is","not","`","float","`","like","."]
code: def __init__(
      self,
      power,
      dtype=tf.int32,
      force_probs_to_zero_outside_support=False,
      sample_maximum_iterations=100,
      validate_args=False,
      allow_nan_stats=False,
      name="Zipf",
  ):
      """Initialize a batch of Zipf distributions.
  
      Args:
        power: `Float` like `Tensor` representing the power parameter. Must be
          strictly greater than `1`.
        dtype: The `dtype` of `Tensor` returned by `sample`.
          Default value: `tf.int32`.
        force_probs_to_zero_outside_support: Python `bool`. When `True`,
          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 Zipf pmf at integer
          values `k` but produces an unrestricted result on other inputs.  In the
          case of Zipf, the `log_prob` formula in this case happens to be the
          continuous function `-power log(k) - log(zeta(power))`.  Note that this
          function is not itself a normalized probability log-density.
          Default value: `False`.
        sample_maximum_iterations: Maximum number of iterations of allowable
          iterations in `sample`. When `validate_args=True`, samples which fail to
          reach convergence (subject to this cap) are masked out with
          `self.dtype.min` or `nan` depending on `self.dtype.is_integer`.
          Default value: `100`.
        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.
          Default value: `False`.
        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.
          Default value: `False`.
        name: Python `str` name prefixed to Ops created by this class.
          Default value: `'Zipf'`.
  
      Raises:
        TypeError: if `power` is not `float` like.
      """
      parameters = dict(locals())
      with tf.name_scope(name) as name:
          self._power = tensor_util.convert_nonref_to_tensor(
              power,
              name="power",
              dtype=dtype_util.common_dtype(
                  [power], dtype_hint=tf.float32
              ),
          )
          if not dtype_util.is_floating(
              self._power.dtype
          ) or dtype_util.base_equal(self._power.dtype, tf.float16):
              raise TypeError(
                  "power.dtype ({}) is not a supported `float` type.".format(
                      dtype_util.name(self._power.dtype)
                  )
              )
          self._force_probs_to_zero_outside_support = (
              force_probs_to_zero_outside_support
          )
          self._sample_maximum_iterations = sample_maximum_iterations
          super(Zipf, 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 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.internal import tensorshape_util
label_desc: Use image node_id 1 to create a new Zipf object from inherited base classes: distribution, distribution with example: obj = Zipf(power, dtype, force_probs_to_zero_outside_support, sample_maximum_iterations, validate_args, allow_nan_stats, name)