class_docstr: Chi2 distribution.
  
  The Chi2 distribution is defined over positive real numbers using a degrees of
  freedom ('df') parameter.
  
  #### Mathematical Details
  
  The probability density function (pdf) is,
  
  ```none
  pdf(x; df, x > 0) = x**(0.5 df - 1) exp(-0.5 x) / Z
  Z = 2**(0.5 df) Gamma(0.5 df)
  ```
  
  where:
  
  * `df` denotes the degrees of freedom,
  * `Z` is the normalization constant, and,
  * `Gamma` is the [gamma function](
    https://en.wikipedia.org/wiki/Gamma_function).
  
  The Chi2 distribution is a special case of the Gamma distribution -- i.e.,
  `Chi2(df)` represents the same distribution as
  `Gamma(concentration=0.5 * df, rate=0.5)`.
class_docstr_tok: ["Chi2","distribution",".","The","Chi2","distribution","is","defined","over","positive","real","numbers","using","a","degrees","of","freedom","(","'df","'",")","parameter",".","#","#","#","#","Mathematical","Details","The","probability","density","function","(","pdf",")","is",",","``","`","none","pdf","(","x",";","df",",","x",">","0",")","=","x","*","*","(","0.5","df","-","1",")","exp","(","-0.5","x",")","\/","Z","Z","=","2","*","*","(","0.5","df",")","Gamma","(","0.5","df",")","``","`","where",":","*","`","df","`","denotes","the","degrees","of","freedom",",","*","`","Z","`","is","the","normalization","constant",",","and",",","*","`","Gamma","`","is","the","[","gamma","function","]","(","https",":","\/\/en.wikipedia.org\/wiki\/Gamma_function",")",".","The","Chi2","distribution","is","a","special","case","of","the","Gamma","distribution","--","i.e.",",","`","Chi2","(","df",")","`","represents","the","same","distribution","as","`","Gamma","(","concentration=0.5","*","df",",","rate=0.5",")","`","."]
docstr: Construct Chi2 distributions with parameter `df`.
  
  Args:
    df: Floating point tensor, the degrees of freedom of the
      distribution(s). `df` must contain only positive values.
    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","Chi2","distributions","with","parameter","`","df","`",".","Args",":","df",":","Floating","point","tensor",",","the","degrees","of","freedom","of","the","distribution","(","s",")",".","`","df","`","must","contain","only","positive","values",".","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, df, validate_args=False, allow_nan_stats=True, name="Chi2"
  ):
      """Construct Chi2 distributions with parameter `df`.
  
      Args:
        df: Floating point tensor, the degrees of freedom of the
          distribution(s). `df` must contain only positive values.
        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([df], dtype_hint=tf.float32)
          self._df = tensor_util.convert_nonref_to_tensor(
              df, name="df", dtype=dtype
          )
          super(Chi2, self).__init__(
              dtype=dtype,
              validate_args=validate_args,
              allow_nan_stats=allow_nan_stats,
              reparameterization_type=reparameterization.FULLY_REPARAMETERIZED,
              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.distributions import gamma
  from tensorflow_probability.python.distributions import kullback_leibler
  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 reparameterization
  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 Chi2 object from inherited base classes: distribution with example: obj = Chi2(df, validate_args, allow_nan_stats, name)