Fix mvlgamma doc (#17045)
Summary:
Changelog:
- Fix the constant in the docs
Pull Request resolved: https://github.com/pytorch/pytorch/pull/17045
Differential Revision: D14068698
Pulled By: ezyang
fbshipit-source-id: af040b9a9badea213785f5bf3b6daf4d90050eb2
diff --git a/torch/_torch_docs.py b/torch/_torch_docs.py
index 3931050..544e301 100644
--- a/torch/_torch_docs.py
+++ b/torch/_torch_docs.py
@@ -3159,12 +3159,12 @@
r"""
mvlgamma(input, p) -> Tensor
-Computes the multivariate log-gamma function with dimension :math:`p` element-wise, given by
+Computes the multivariate log-gamma function (`[reference]`_) with dimension :math:`p` element-wise, given by
.. math::
\log(\Gamma_{p}(a)) = C + \displaystyle \sum_{i=1}^{p} \log\left(\Gamma\left(a - \frac{i - 1}{2}\right)\right)
-where :math:`C = \log(\pi) \times \frac{p (p - 1)}{2}` and :math:`\Gamma(\cdot)` is the Gamma function.
+where :math:`C = \log(\pi) \times \frac{p (p - 1)}{4}` and :math:`\Gamma(\cdot)` is the Gamma function.
If any of the elements are less than or equal to :math:`\frac{p - 1}{2}`, then an error
is thrown.
@@ -3182,6 +3182,8 @@
>>> torch.mvlgamma(a, 2)
tensor([[0.3928, 0.4007, 0.7586],
[1.0311, 0.3901, 0.5049]])
+
+.. _`[reference]`: https://en.wikipedia.org/wiki/Multivariate_gamma_function
""")
add_docstr(torch.narrow,