mindspore.ops.polygamma
- mindspore.ops.polygamma(n, input)[source]
Computes the \(n\)-th derivative of the polygamma function on input.
\[\psi^{(a)}(x) = \frac{d^{(a)}}{dx^{(a)}} \psi(x)\]where \(\psi(x)\) is the digamma function.
- Parameters
- Returns
Tensor, has the same dtype as input.
- Raises
- Supported Platforms:
GPU
CPU
Examples
>>> import mindspore >>> import numpy as np >>> from mindspore import Tensor, ops >>> x = Tensor(np.array([3.14, -2.71]), mindspore.float64) >>> a = Tensor(np.array(1), mindspore.int64) >>> output = ops.polygamma(a, x) >>> print(output) [ 0.37446456 15.49884838]