mindspore.mint.erf

View Source On Gitee
mindspore.mint.erf(input)[source]

Compute the Gauss error of input tensor element-wise.

erf(x)=2π0xet2dt
Parameters

input (Tensor) – The input tensor.

Returns

Tensor

Supported Platforms:

Ascend

Examples

>>> import mindspore
>>> # The dtype of output is float32 when dtype of input is int64.
>>> input = mindspore.tensor([-1, 0, 1, 2, 3], mindspore.int64)
>>> mindspore.mint.erf(input)
Tensor(shape=[5], dtype=Float32, value= [-8.42700793e-01,  0.00000000e+00,  8.42700793e-01,  9.95322265e-01,  9.99977910e-01])
>>>
>>> # Otherwise output has the same dtype as the input.
>>> input = mindspore.tensor([-1, 0, 1, 2, 3], mindspore.float64)
>>> mindspore.mint.erf(input)
Tensor(shape=[5], dtype=Float64, value= [-8.42700793e-01,  0.00000000e+00,  8.42700793e-01,  9.95322265e-01,  9.99977910e-01])