mindspore.mint.erfinv

mindspore.mint.erfinv(input)[source]

Returns the result of the inverse error function with input, which is defined in the range (-1, 1) as:

\[erfinv(erf(x)) = x\]

where \(x\) is the input.

Parameters

input (Tensor) –

The input tensor to compute with. Supported dtypes:

  • Ascend: float16, float32, int8, int16, int32, int64, uint8, bool.

Returns

Tensor. When the input is int8, int16, int32, int64, uint8, bool, the return value type is float32. Otherwise, the return value type is the same as the input type.

Raises

TypeError

If dtype of input is not as follows

  • Ascend: float16, float32, int8, int16, int32, int64, uint8, bool.

Supported Platforms:

Ascend

Examples

>>> import mindspore
>>> import numpy as np
>>> from mindspore import Tensor, mint
>>> input = Tensor(np.array([0, 0.5, -0.9]), mindspore.float32)
>>> output = mint.erfinv(input)
>>> print(output)
[ 0.          0.47693613 -1.1630869 ]