erf

paddle. erf ( x, name=None ) [source]

Erf Operator For more details, see Error function.

Equation:
\[out = \frac{2}{\sqrt{\pi}} \int_{0}^{x}e^{- \eta^{2}}d\eta\]
Parameters
  • x (Tensor) – The input tensor, it’s data type should be float32, float64.

  • name (str, optional) – Name for the operation (optional, default is None). For more information, please refer to Name.

Returns

The output of Erf, dtype: float32 or float64, the same as the input, shape: the same as the input.

Return type

Tensor

Examples

import paddle

x = paddle.to_tensor([-0.4, -0.2, 0.1, 0.3])
out = paddle.erf(x)
print(out)
# [-0.42839236 -0.22270259  0.11246292  0.32862676]