Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PyTorch torch.polygamma function

PyTorch torch.polygamma function


PyTorch torch reference manual 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

)

print

(

result

)


PyTorch torch reference manual PyTorch torch reference manual