PyTorch torch.digamma function
PyTorch torch reference manual
torch.digamma is a PyTorch function for computing the psi function (logarithmic derivative) element-wise.
Function definition
torch.digamma(input, *, out=None)
Usage examples
Example
import
torch
Example of computing the psi function
x
=
torch.
tensor
(
[
1.0
,
2.0
,
3.0
,
4.0
]
,
dtype
=
torch.
float32
)
result
=
torch.
digamma
(
x
)
(
result
)