Polygamma(n,x) is not implemented for n>=2 at /pytorch/aten/src/THC/generic/THCTensorMathPointwise.cu:364

As document state here: https://pytorch.org/docs/master/torch.html
torch.polygamma(n, x) only works when n = 0, 1
in my forward neural network, torch.polygamma(1, x) works normal.
But, come to loss.backward()
it raise the error said polygamma(n,x) is not implemented for n>=2.
I do understand the derivative of polygamma(1, x) is polygamma (2, x). how should I get this function derivative.

1 Like