torch.digamma
-
torch.digamma(input, *, out=None) → Tensor -
Computes the logarithmic derivative of the gamma function on
input.- Parameters
-
input (Tensor) – the tensor to compute the digamma function on
- Keyword Arguments
-
out (Tensor, optional) – the output tensor.
Note
This function is similar to SciPy’s
scipy.special.digamma.Note
From PyTorch 1.8 onwards, the digamma function returns
-Inffor0. Previously it returnedNaNfor0.Example:
>>> a = torch.tensor([1, 0.5]) >>> torch.digamma(a) tensor([-0.5772, -1.9635])
© 2019 Torch Contributors
Licensed under the 3-clause BSD License.
https://pytorch.org/docs/1.8.0/generated/torch.digamma.html