class_docstr: Bates distribution.
  
  The Bates distribution is the distribution of the average of `total_count`
  independent samples from `Uniform(low, high)`. It is parameterized by the
  interval bounds `low` and `high`, and `total_count`, the number of samples.
  
  Although some care has been taken to avoid numerical issues, the `pdf`, `cdf`,
  and log versions thereof may still exhibit numerical instability. They are
  relatively stable near the tails; however near the mode they are unstable if
  `total_count` is greater than about `75` for `tf.float64`, `25` for
  `tf.float32`, and `7` for `tf.float16`. Beyond these limits a warning will be
  shown if `validate_args=False`; otherwise an exception is thrown. For high
  `total_count`, consider using a `Normal` approximation.
  
  #### Mathematical Details
  
  The probability density function (pdf) is supported in the interval
  `[low, high]`. If `[low, high]` is the unit interval `[0, 1]`, the pdf
  is,
  
  ```none
  pdf(x; n, 0, 1) =
    ((n / (n-1)!) sum_{k=0}^j (-1)^k (n choose k) (nx - k)^{n-1}
  ```
  
  where
  * `total_count = n`,
  * `j = floor(nx)`
  * `n!` is the factorial of `n`,
  * `(n choose k)` is the binomial coefficient `n! / (k!(n - k)!),
  
  For arbitrary intervals `[low, high]`, the pdf is,
  
  ```none
  pdf(x; n, low, high) = pdf((x - low) / (high - low); n, 0, 1) / (high - low)
  ```
  
  #### Examples
  
  Create a single distribution for the mean of 5 uniform random variables on the
  interval `[-10, 5]`.
  
  ```python
  dist = tfd.Bates(total_count=5., low=-10., high=5.)
  ```
  
  Create a 3-batch of distributions with varying total counts and intervals.
  
  ```python
  counts = [1., 2., 5.]
  # high will be broadcast to [100., 100., 100.]
  dist = tfd.Bates(total_count=counts, low=[0., 5., 10.], high=100.)
  ```
  
  Compute some values for the pdf.
  
  ```python
  dist.prob(50.)    # shape: [3]
  x = [[50., 50., 50.],
       [5., 10., 20.]]      # shape: [2, 3]
  dist.prob(x)      # shape: [2, 3]
  ```
docstr: Construct a Bates distribution.
  
  Args:
    total_count: Non-negative integer-valued `Tensor` with shape broadcastable
      to the batch shape `[N1,..., Nm]`, `m >= 0`. This controls the number of
      samples of `Uniform(low, high)` to take the mean of.
    low: Floating point `Tensor` representing the lower bounds of the support.
      Should be broadcastable to `[N1,..., Nm]` with `m >= 0`, the same dtype
      as `total_count`, and `low < high` component-wise, after broadcasting.
      Defaults to `0`.
    high: Floating point `Tensor` representing the upper bounds of the
      support.  Should be broadcastable to `[N1,..., Nm]` with `m >= 0`, the
      same dtype as `total_count`, and `low < high` component-wise, after
      broadcasting.  Defaults to `1`.
    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","a","Bates","distribution",".","Args",":","total_count",":","Non-negative","integer-valued","`","Tensor","`","with","shape","broadcastable","to","the","batch","shape","`","[","N1",",","...",",","Nm","]","`",",","`","m",">","=","0","`",".","This","controls","the","number","of","samples","of","`","Uniform","(","low",",","high",")","`","to","take","the","mean","of",".","low",":","Floating","point","`","Tensor","`","representing","the","lower","bounds","of","the","support",".","Should","be","broadcastable","to","`","[","N1",",","...",",","Nm","]","`","with","`","m",">","=","0","`",",","the","same","dtype","as","`","total_count","`",",","and","`","low","<","high","`","component-wise",",","after","broadcasting",".","Defaults","to","`","0","`",".","high",":","Floating","point","`","Tensor","`","representing","the","upper","bounds","of","the","support",".","Should","be","broadcastable","to","`","[","N1",",","...",",","Nm","]","`","with","`","m",">","=","0","`",",","the","same","dtype","as","`","total_count","`",",","and","`","low","<","high","`","component-wise",",","after","broadcasting",".","Defaults","to","`","1","`",".","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,
      total_count,
      low=0.0,
      high=1.0,
      validate_args=False,
      allow_nan_stats=True,
      name="Bates",
  ):
      """Construct a Bates distribution.
  
      Args:
        total_count: Non-negative integer-valued `Tensor` with shape broadcastable
          to the batch shape `[N1,..., Nm]`, `m >= 0`. This controls the number of
          samples of `Uniform(low, high)` to take the mean of.
        low: Floating point `Tensor` representing the lower bounds of the support.
          Should be broadcastable to `[N1,..., Nm]` with `m >= 0`, the same dtype
          as `total_count`, and `low < high` component-wise, after broadcasting.
          Defaults to `0`.
        high: Floating point `Tensor` representing the upper bounds of the
          support.  Should be broadcastable to `[N1,..., Nm]` with `m >= 0`, the
          same dtype as `total_count`, and `low < high` component-wise, after
          broadcasting.  Defaults to `1`.
        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())
  
      with tf.name_scope(name) as name:
          dtype = dtype_util.common_dtype(
              [low, high], dtype_hint=tf.float32
          )
          assert dtype in (
              tf.float32,
              tf.float64,
          ), "`Bates` only supports `tf.float32` or `tf.float64`"
          self._total_count = tensor_util.convert_nonref_to_tensor(
              total_count, name="total_count", dtype_hint=dtype
          )
          self._low = tensor_util.convert_nonref_to_tensor(
              low, dtype=dtype, name="low"
          )
          self._high = tensor_util.convert_nonref_to_tensor(
              high, dtype=dtype, name="high"
          )
          super(Bates, 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 sys
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import sigmoid
  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 special
label_desc: Use image node_id 1 to create a new Bates object from inherited base classes: distribution with example: obj = Bates(total_count, low, high, validate_args, allow_nan_stats, name)