mindspore.ops.Betainc

class mindspore.ops.Betainc[source]

Computes the regularized incomplete beta integral \(I_{x}(a, b)\).

The regularized incomplete beta integral is defined as:

\[I_{x}(a, b)=\frac{B(x ; a, b)}{B(a, b)}\]

where

\[B(x ; a, b)=\int_{0}^{x} t^{a-1}(1-t)^{b-1} d t\]

is the incomplete beta function and B(a, b) is the complete beta function

Inputs:
  • a (Tensor) - A Tensor of types: float32, float64.

  • b (Tensor) - A Tensor, must have the same dtype and shape as a .

  • x (Tensor) - A Tensor, must have the same dtype and shape as a .

Outputs:

A Tensor, has the same dtype and shape as a .

Raises
  • TypeError – If dtype of a is not float32 nor float64.

  • TypeError – If either dtype of b and x is not the same as the a.

  • ValueError – If either shape of b and x is not the same as the a.

Supported Platforms:

Ascend GPU CPU

Examples

>>> a = Tensor(np.array([1, 1, 1]), mindspore.float32)
>>> b = Tensor(np.array([1, 1, 1]), mindspore.float32)
>>> x = Tensor(np.array([1, 1,1 ]), mindspore.float32)
>>> betainc = ops.Betainc()
>>> print(betainc(a, b, x))
[1. 1. 1.]