class_docstr: The matrix Wishart distribution on positive definite matrices.
  
  This distribution is defined by a scalar number of degrees of freedom `df` and
  an instance of `LinearOperator`, which provides matrix-free access to a
  symmetric positive definite operator, which defines the scale matrix.
  
  #### Mathematical Details
  
  The probability density function (pdf) is,
  
  ```none
  pdf(X; df, scale) = det(X)**(0.5 (df-k-1)) exp(-0.5 tr[inv(scale) X]) / Z
  Z = 2**(0.5 df k) |det(scale)|**(0.5 df) Gamma_k(0.5 df)
  ```
  
  where:
  
  * `df >= k` denotes the degrees of freedom,
  * `scale` is a symmetric, positive definite, `k x k` matrix,
  * `Z` is the normalizing constant, and,
  * `Gamma_k` is the [multivariate Gamma function](
    https://en.wikipedia.org/wiki/Multivariate_gamma_function).
  
  #### Examples
  
  See the `Wishart` class for examples of initializing and using this class.
class_docstr_tok: ["The","matrix","Wishart","distribution","on","positive","definite","matrices",".","This","distribution","is","defined","by","a","scalar","number","of","degrees","of","freedom","`","df","`","and","an","instance","of","`","LinearOperator","`",",","which","provides","matrix-free","access","to","a","symmetric","positive","definite","operator",",","which","defines","the","scale","matrix",".","#","#","#","#","Mathematical","Details","The","probability","density","function","(","pdf",")","is",",","``","`","none","pdf","(","X",";","df",",","scale",")","=","det","(","X",")","*","*","(","0.5","(","df-k-1",")",")","exp","(","-0.5","tr","[","inv","(","scale",")","X","]",")","\/","Z","Z","=","2","*","*","(","0.5","df","k",")","|det","(","scale",")","|","*","*","(","0.5","df",")","Gamma_k","(","0.5","df",")","``","`","where",":","*","`","df",">","=","k","`","denotes","the","degrees","of","freedom",",","*","`","scale","`","is","a","symmetric",",","positive","definite",",","`","k","x","k","`","matrix",",","*","`","Z","`","is","the","normalizing","constant",",","and",",","*","`","Gamma_k","`","is","the","[","multivariate","Gamma","function","]","(","https",":","\/\/en.wikipedia.org\/wiki\/Multivariate_gamma_function",")",".","#","#","#","#","Examples","See","the","`","Wishart","`","class","for","examples","of","initializing","and","using","this","class","."]
docstr: Construct Wishart distributions.
  
  Args:
    df: `float` or `double` tensor, the degrees of freedom of the
      distribution(s). `df` must be greater than or equal to `k`.
    scale: `float` or `double` instance of `LinearOperator`.
    input_output_cholesky: Python `bool`. If `True`, functions whose input or
      output have the semantics of samples assume inputs are in Cholesky form
      and return outputs in Cholesky form. In particular, if this flag is
      `True`, input to `log_prob` is presumed of Cholesky form and output from
      `sample`, `mean`, and `mode` are of Cholesky form.  Setting this
      argument to `True` is purely a computational optimization and does not
      change the underlying distribution; for instance, `mean` returns the
      Cholesky of the mean, not the mean of Cholesky factors. The `variance`
      and `stddev` methods are unaffected by this flag.
      Default value: `False` (i.e., input/output does not have Cholesky
      semantics).
    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.
  
  Raises:
    TypeError: if scale is not floating-type
    TypeError: if scale.dtype != df.dtype
    ValueError: if df < k, where scale operator event shape is
      `(k, k)`
docstr_tok: ["Construct","Wishart","distributions",".","Args",":","df",":","`","float","`","or","`","double","`","tensor",",","the","degrees","of","freedom","of","the","distribution","(","s",")",".","`","df","`","must","be","greater","than","or","equal","to","`","k","`",".","scale",":","`","float","`","or","`","double","`","instance","of","`","LinearOperator","`",".","input_output_cholesky",":","Python","`","bool","`",".","If","`","True","`",",","functions","whose","input","or","output","have","the","semantics","of","samples","assume","inputs","are","in","Cholesky","form","and","return","outputs","in","Cholesky","form",".","In","particular",",","if","this","flag","is","`","True","`",",","input","to","`","log_prob","`","is","presumed","of","Cholesky","form","and","output","from","`","sample","`",",","`","mean","`",",","and","`","mode","`","are","of","Cholesky","form",".","Setting","this","argument","to","`","True","`","is","purely","a","computational","optimization","and","does","not","change","the","underlying","distribution",";","for","instance",",","`","mean","`","returns","the","Cholesky","of","the","mean",",","not","the","mean","of","Cholesky","factors",".","The","`","variance","`","and","`","stddev","`","methods","are","unaffected","by","this","flag",".","Default","value",":","`","False","`","(","i.e.",",","input\/output","does","not","have","Cholesky","semantics",")",".","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",".","Raises",":","TypeError",":","if","scale","is","not","floating-type","TypeError",":","if","scale.dtype","!","=","df.dtype","ValueError",":","if","df","<","k",",","where","scale","operator","event","shape","is","`","(","k",",","k",")","`"]
code: def __init__(
      self,
      df,
      scale,
      input_output_cholesky=False,
      validate_args=False,
      allow_nan_stats=True,
      name="WishartLinearOperator",
  ):
      """Construct Wishart distributions.
  
      Args:
        df: `float` or `double` tensor, the degrees of freedom of the
          distribution(s). `df` must be greater than or equal to `k`.
        scale: `float` or `double` instance of `LinearOperator`.
        input_output_cholesky: Python `bool`. If `True`, functions whose input or
          output have the semantics of samples assume inputs are in Cholesky form
          and return outputs in Cholesky form. In particular, if this flag is
          `True`, input to `log_prob` is presumed of Cholesky form and output from
          `sample`, `mean`, and `mode` are of Cholesky form.  Setting this
          argument to `True` is purely a computational optimization and does not
          change the underlying distribution; for instance, `mean` returns the
          Cholesky of the mean, not the mean of Cholesky factors. The `variance`
          and `stddev` methods are unaffected by this flag.
          Default value: `False` (i.e., input/output does not have Cholesky
          semantics).
        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.
  
      Raises:
        TypeError: if scale is not floating-type
        TypeError: if scale.dtype != df.dtype
        ValueError: if df < k, where scale operator event shape is
          `(k, k)`
      """
      parameters = dict(locals())
      self._input_output_cholesky = input_output_cholesky
      with tf.name_scope(name) as name:
          dtype = dtype_util.common_dtype(
              [scale, df], dtype_hint=tf.float32
          )
          self._scale = scale
          self._df = tensor_util.convert_nonref_to_tensor(
              df, name="df", dtype=dtype
          )
  
          super(WishartLinearOperator, 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 math
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import chain
  from tensorflow_probability.python.bijectors import cholesky_outer_product
  from tensorflow_probability.python.bijectors import fill_scale_tril
  from tensorflow_probability.python.bijectors import softplus
  from tensorflow_probability.python.bijectors import transform_diagonal
  from tensorflow_probability.python.distributions import distribution
  from tensorflow_probability.python.distributions import gamma
  from tensorflow_probability.python.internal import assert_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 WishartLinearOperator object from inherited base classes: distribution with example: obj = WishartLinearOperator(df, scale, input_output_cholesky, validate_args, allow_nan_stats, name)