class_docstr: Student's t-distribution.
  
  This distribution has parameters: degree of freedom `df`, location `loc`,
  and `scale`.
  
  #### Mathematical details
  
  The probability density function (pdf) is,
  
  ```none
  pdf(x; df, mu, sigma) = (1 + y**2 / df)**(-0.5 (df + 1)) / Z
  where,
  y = (x - mu) / sigma
  Z = abs(sigma) sqrt(df pi) Gamma(0.5 df) / Gamma(0.5 (df + 1))
  ```
  
  where:
  * `loc = mu`,
  * `scale = sigma`, and,
  * `Z` is the normalization constant, and,
  * `Gamma` is the [gamma function](
    https://en.wikipedia.org/wiki/Gamma_function).
  
  The StudentT distribution is a member of the [location-scale family](
  https://en.wikipedia.org/wiki/Location-scale_family), i.e., it can be
  constructed as,
  
  ```none
  X ~ StudentT(df, loc=0, scale=1)
  Y = loc + scale * X
  ```
  
  Notice that `scale` has semantics more similar to standard deviation than
  variance. However it is not actually the std. deviation; the Student's
  t-distribution std. dev. is `scale sqrt(df / (df - 2))` when `df > 2`.
  
  Samples of this distribution are reparameterized (pathwise differentiable).
  The derivatives are computed using the approach described in the paper
  
  [Michael Figurnov, Shakir Mohamed, Andriy Mnih.
  Implicit Reparameterization Gradients, 2018](https://arxiv.org/abs/1805.08498)
  
  #### Examples
  
  Examples of initialization of one or a batch of distributions.
  
  ```python
  import tensorflow_probability as tfp
  tfd = tfp.distributions
  
  # Define a single scalar Student t distribution.
  single_dist = tfd.StudentT(df=3)
  
  # Evaluate the pdf at 1, returning a scalar Tensor.
  single_dist.prob(1.)
  
  # Define a batch of two scalar valued Student t's.
  # The first has degrees of freedom 2, mean 1, and scale 11.
  # The second 3, 2 and 22.
  multi_dist = tfd.StudentT(df=[2, 3], loc=[1, 2.], scale=[11, 22.])
  
  # Evaluate the pdf of the first distribution on 0, and the second on 1.5,
  # returning a length two tensor.
  multi_dist.prob([0, 1.5])
  
  # Get 3 samples, returning a 3 x 2 tensor.
  multi_dist.sample(3)
  ```
  
  Arguments are broadcast when possible.
  
  ```python
  # Define a batch of two Student's t distributions.
  # Both have df 2 and mean 1, but different scales.
  dist = tfd.StudentT(df=2, loc=1, scale=[11, 22.])
  
  # Evaluate the pdf of both distributions on the same point, 3.0,
  # returning a length 2 tensor.
  dist.prob(3.0)
  ```
  
  Compute the gradients of samples w.r.t. the parameters:
  
  ```python
  df = tf.constant(2.0)
  loc = tf.constant(2.0)
  scale = tf.constant(11.0)
  dist = tfd.StudentT(df=df, loc=loc, scale=scale)
  samples = dist.sample(5)  # Shape [5]
  loss = tf.reduce_mean(tf.square(samples))  # Arbitrary loss function
  # Unbiased stochastic gradients of the loss function
  grads = tf.gradients(loss, [df, loc, scale])
  ```
class_docstr_tok: ["Student","'s","t-distribution",".","This","distribution","has","parameters",":","degree","of","freedom","`","df","`",",","location","`","loc","`",",","and","`","scale","`",".","#","#","#","#","Mathematical","details","The","probability","density","function","(","pdf",")","is",",","``","`","none","pdf","(","x",";","df",",","mu",",","sigma",")","=","(","1","+","y","*","*","2","\/","df",")","*","*","(","-0.5","(","df","+","1",")",")","\/","Z","where",",","y","=","(","x","-","mu",")","\/","sigma","Z","=","abs","(","sigma",")","sqrt","(","df","pi",")","Gamma","(","0.5","df",")","\/","Gamma","(","0.5","(","df","+","1",")",")","``","`","where",":","*","`","loc","=","mu","`",",","*","`","scale","=","sigma","`",",","and",",","*","`","Z","`","is","the","normalization","constant",",","and",",","*","`","Gamma","`","is","the","[","gamma","function","]","(","https",":","\/\/en.wikipedia.org\/wiki\/Gamma_function",")",".","The","StudentT","distribution","is","a","member","of","the","[","location-scale","family","]","(","https",":","\/\/en.wikipedia.org\/wiki\/Location-scale_family",")",",","i.e.",",","it","can","be","constructed","as",",","``","`","none","X","~","StudentT","(","df",",","loc=0",",","scale=1",")","Y","=","loc","+","scale","*","X","``","`","Notice","that","`","scale","`","has","semantics","more","similar","to","standard","deviation","than","variance",".","However","it","is","not","actually","the","std",".","deviation",";","the","Student's","t-distribution","std",".","dev",".","is","`","scale","sqrt","(","df","\/","(","df","-","2",")",")","`","when","`","df",">","2","`",".","Samples","of","this","distribution","are","reparameterized","(","pathwise","differentiable",")",".","The","derivatives","are","computed","using","the","approach","described","in","the","paper","[","Michael","Figurnov",",","Shakir","Mohamed",",","Andriy","Mnih",".","Implicit","Reparameterization","Gradients",",","2018","]","(","https",":","\/\/arxiv.org\/abs\/1805.08498",")","#","#","#","#","Examples","Examples","of","initialization","of","one","or","a","batch","of","distributions",".","``","`","python","import","tensorflow_probability","as","tfp","tfd","=","tfp.distributions","#","Define","a","single","scalar","Student","t","distribution",".","single_dist","=","tfd.StudentT","(","df=3",")","#","Evaluate","the","pdf","at","1",",","returning","a","scalar","Tensor",".","single_dist.prob","(","1",".",")","#","Define","a","batch","of","two","scalar","valued","Student","t","'s",".","#","The","first","has","degrees","of","freedom","2",",","mean","1",",","and","scale","11",".","#","The","second","3",",","2","and","22.","multi_dist","=","tfd.StudentT","(","df=","[","2",",","3","]",",","loc=","[","1",",","2",".","]",",","scale=","[","11",",","22",".","]",")","#","Evaluate","the","pdf","of","the","first","distribution","on","0",",","and","the","second","on","1.5",",","#","returning","a","length","two","tensor",".","multi_dist.prob","(","[","0",",","1.5","]",")","#","Get","3","samples",",","returning","a","3","x","2","tensor",".","multi_dist.sample","(","3",")","``","`","Arguments","are","broadcast","when","possible",".","``","`","python","#","Define","a","batch","of","two","Student","'s","t","distributions",".","#","Both","have","df","2","and","mean","1",",","but","different","scales",".","dist","=","tfd.StudentT","(","df=2",",","loc=1",",","scale=","[","11",",","22",".","]",")","#","Evaluate","the","pdf","of","both","distributions","on","the","same","point",",","3.0",",","#","returning","a","length","2","tensor",".","dist.prob","(","3.0",")","``","`","Compute","the","gradients","of","samples","w.r.t",".","the","parameters",":","``","`","python","df","=","tf.constant","(","2.0",")","loc","=","tf.constant","(","2.0",")","scale","=","tf.constant","(","11.0",")","dist","=","tfd.StudentT","(","df=df",",","loc=loc",",","scale=scale",")","samples","=","dist.sample","(","5",")","#","Shape","[","5","]","loss","=","tf.reduce_mean","(","tf.square","(","samples",")",")","#","Arbitrary","loss","function","#","Unbiased","stochastic","gradients","of","the","loss","function","grads","=","tf.gradients","(","loss",",","[","df",",","loc",",","scale","]",")","``","`"]
docstr: Scaling factors of these Student's t distribution(s).
code: def scale(self):
      """Scaling factors of these Student's t distribution(s)."""
      return self._scale
  
imports: import functools
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import identity
  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.internal import assert_util
  from tensorflow_probability.python.internal import custom_gradient
  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 special_math
  from tensorflow_probability.python.internal import tensor_util
  from tensorflow_probability.python.math import generic
  from tensorflow_probability.python.math import gradient
  from tensorflow_probability.python.math import numeric
  from tensorflow_probability.python.math import special
label_desc: Use image node_id 5 for calling the StudentT obj's underlying member method code with example usage: obj.scale() and returns: self