# torch.polygamma¶

torch.polygamma(n, input, out=None) → Tensor

Computes the $n^{th}$ derivative of the digamma function on input. $n \geq 0$ is called the order of the polygamma function.

$\psi^{(n)}(x) = \frac{d^{(n)}}{dx^{(n)}} \psi(x)$

Note

This function is not implemented for $n \geq 2$ .

Parameters
• n (int) – the order of the polygamma function

• input (Tensor) – the input tensor.

• out (Tensor, optional) – the output tensor.

Example::
>>> a = torch.tensor([1, 0.5])
>>> torch.polygamma(1, a)
tensor([1.64493, 4.9348])