PyTorch torch.polygamma function
PyTorch torch reference manual
torch.polygamma is a function in PyTorch used to compute the element-wise polygamma function.
Function definition
torch.polygamma(n, input, out=None)
Usage examples
Example
import
torch
Compute the polygamma function
x
=
torch.
tensor
(
[
1.0
,
2.0
,
3.0
]
)
n
=
1
result
=
torch.
polygamma
(
n
,
x
)
(
result
)