mindspore.ops.igammac

View Source On Gitee
mindspore.ops.igammac(input, other)[source]

Calculates upper regularized incomplete Gamma function.

If we define input as a and other as x, the upper regularized incomplete Gamma function is defined as:

\[Q(a, x) = Gamma(a, x) / Gamma(a) = 1 - P(a, x)\]

where

\[Gamma(a, x) = \int_{x}^{\infty} t^{a-1} exp(-t) dt\]

is the upper incomplete Gama function.

Above \(P(a, x)\) is the lower regularized complete Gamma function.

Warning

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

Parameters
  • input (Tensor) – The first input tensor. With type of float32 or float64.

  • other (Tensor) – The second input tensor. With float32 or float64 type. other should have the same dtype with input.

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.igammac(a, x)
>>> print (output)
[0.40600586 0.6472318 0.7851304 0.8666283]