mindspore.ops.Erf
- class mindspore.ops.Erf[source]
Computes the Gauss error function of x element-wise.
Refer to
mindspore.ops.erf()
for more details.- Inputs:
x (Tensor) - Input Tensor of Gaussian error function. Supported dtypes:
Ascend: float16, float32.
GPU/CPU: float16, float32, float64.
- Outputs:
Tensor, has the same shape and dtype as the x.
- Supported Platforms:
Ascend
GPU
CPU
Examples
>>> import mindspore >>> import numpy as np >>> from mindspore import Tensor, ops >>> x = Tensor(np.array([-1, 0, 1, 2, 3]), mindspore.float32) >>> erf = ops.Erf() >>> output = erf(x) >>> print(output) [-0.8427168 0. 0.8427168 0.99530876 0.99997765]