mindspore.ops.digamma

View Source On Gitee
mindspore.ops.digamma(input)[source]

Computes the derivative of the lgamma function on input.

\[P(x) = \frac{d}{dx}(\ln (\Gamma(x)))\]

Warning

This is an experimental API that is subject to change or deletion.

Parameters

input (Tensor) – The input tensor. With type of float16 or float32 or float64.

Returns

Tensor, has the same dtype as input.

Raises
  • TypeError – If input is not a Tensor.

  • TypeError – If dtype of input is not float16 or float32 or float64.

Supported Platforms:

GPU CPU

Examples

>>> import numpy as np
>>> from mindspore import Tensor, ops
>>> x = Tensor(np.array([1.5, 0.5, 9]).astype(np.float16))
>>> output = ops.digamma(x)
>>> print(output)
[ 0.0365 -1.964   2.14  ]