Skip to content

Commit

Permalink
torch.digamma (pytorch#10967)
Browse files Browse the repository at this point in the history
Summary:
Fixes pytorch#10307

cc SsnL
Pull Request resolved: pytorch#10967

Differential Revision: D9546748

Pulled By: zou3519

fbshipit-source-id: 764e27b1cc8dd487270b3ffa653b806c86f717dd
  • Loading branch information
zou3519 authored and facebook-github-bot committed Aug 29, 2018
1 parent a5d7abe commit 7169906
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/source/torch.rst
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ Pointwise Ops
.. autofunction:: cos
.. autofunction:: cosh
.. autofunction:: div
.. autofunction:: digamma
.. autofunction:: erf
.. autofunction:: erfc
.. autofunction:: erfinv
Expand Down
20 changes: 20 additions & 0 deletions torch/_torch_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1168,6 +1168,26 @@ def parse_kwargs(desc):
[ 1.0500, 0.7336, -0.3836, -1.1015]]])
""")

add_docstr(torch.digamma,
r"""
digamma(input) -> Tensor
Computes the logarithmic derivative of the gamma function on `input`.
.. math::
\psi(x) = \frac{d}{dx} \ln\left(\Gamma\left(x\right)\right) = \frac{\Gamma'(x)}{\Gamma(x)}
Args:
input (Tensor): the tensor to compute the digamma function on
Example::
>>> a = torch.tensor([1, 0.5])
>>> torch.digamma(a)
tensor([-0.5772, -1.9635])
""")


add_docstr(torch.dist,
r"""
dist(input, other, p=2) -> Tensor
Expand Down

0 comments on commit 7169906

Please sign in to comment.