PyTorch
torch / torch
torch.polygamma¶
-
torch.
polygamma
(n, input, *, out=None) → Tensor¶ Computes the nth derivative of the digamma function on
input
. n≥0 is called the order of the polygamma function.ψ(n)(x)=dx(n)d(n)ψ(x)Note
This function is implemented only for nonnegative integers n≥0 .
- Parameters
- Keyword Arguments
out (Tensor, optional) – the output tensor.
- Example::
>>> a = torch.tensor([1, 0.5]) >>> torch.polygamma(1, a) tensor([1.64493, 4.9348]) >>> torch.polygamma(2, a) tensor([ -2.4041, -16.8288]) >>> torch.polygamma(3, a) tensor([ 6.4939, 97.4091]) >>> torch.polygamma(4, a) tensor([ -24.8863, -771.4742])
此页内容是否对您有帮助
感谢反馈!