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: Integral of the `hat` function, used for sampling.
  
  We choose a `hat` function, h(x) = x^(-power), which is a continuous
  (unnormalized) density touching each positive integer at the (unnormalized)
  pmf. This function implements `hat` integral: H(x) = int_x^inf h(t) dt;
  which is needed for sampling purposes.
  
  Args:
    x: A Tensor of points x at which to evaluate H(x).
    power: Power that parameterized hat function.
  
  Returns:
    A Tensor containing evaluation H(x) at x.
docstr_tok: ["Integral","of","the","`","hat","`","function",",","used","for","sampling",".","We","choose","a","`","hat","`","function",",","h","(","x",")","=","x^","(","-power",")",",","which","is","a","continuous","(","unnormalized",")","density","touching","each","positive","integer","at","the","(","unnormalized",")","pmf",".","This","function","implements","`","hat","`","integral",":","H","(","x",")","=","int_x^inf","h","(","t",")","dt",";","which","is","needed","for","sampling","purposes",".","Args",":","x",":","A","Tensor","of","points","x","at","which","to","evaluate","H","(","x",")",".","power",":","Power","that","parameterized","hat","function",".","Returns",":","A","Tensor","containing","evaluation","H","(","x",")","at","x","."]
code: def _hat_integral(self, x, power):
      """Integral of the `hat` function, used for sampling.
  
      We choose a `hat` function, h(x) = x^(-power), which is a continuous
      (unnormalized) density touching each positive integer at the (unnormalized)
      pmf. This function implements `hat` integral: H(x) = int_x^inf h(t) dt;
      which is needed for sampling purposes.
  
      Args:
        x: A Tensor of points x at which to evaluate H(x).
        power: Power that parameterized hat function.
  
      Returns:
        A Tensor containing evaluation H(x) at x.
      """
      x = tf.cast(x, power.dtype)
      t = power - 1.0
      return tf.exp((-t) * tf.math.log1p(x) - tf.math.log(t))
  
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 14 for calling the Zipf obj's underlying member method code with example usage: obj._hat_integral(x, power) and returns: tf