mindspore.ops.igamma
- mindspore.ops.igamma(input, other)[source]
Calculates lower regularized incomplete Gamma function.
If we define input as a and other as x, the lower regularized incomplete Gamma function is defined as:
\[P(a, x) = Gamma(a, x) / Gamma(a) = 1 - Q(a, x)\]where
\[Gamma(a, x) = \int_0^x t^{a-1} \exp^{-t} dt\]is the lower incomplete Gamma function.
Above \(Q(a, x)\) is the upper regularized complete Gamma function.
Warning
This is an experimental API that is subject to change or deletion.
- Parameters
- Returns
Tensor, has the same dtype as input and other.
- Raises
TypeError – If input or other is not a Tensor.
TypeError – If dtype of input other and a is not float32 nor float64.
TypeError – If other has different dtype with input.
ValueError – If input could not be broadcast to a tensor with shape of other.
- Supported Platforms:
Ascend
GPU
CPU
Examples
>>> import numpy as np >>> from mindspore import Tensor, ops >>> a = Tensor(np.array([2.0, 4.0, 6.0, 8.0]).astype(np.float32)) >>> x = Tensor(np.array([2.0, 3.0, 4.0, 5.0]).astype(np.float32)) >>> output = ops.igamma(a, x) >>> print(output) [0.593994 0.35276785 0.21486944 0.13337152]