erf
- paddle. erf ( x: Tensor, name: str | None = None, *, out: Tensor | None = None ) Tensor [source]
-
The error function.
For more details, see Error function.
\[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, uint8, int8, int16, int32, int64. Alias:
input.name (str|None, optional) – Name for the operation (optional, default is None). For more information, please refer to api_guide_Name.
- Keyword Arguments
-
out (Tensor, optional) – The output tensor that has the computed result.
- Returns
-
float32 or float64 (integer types are autocasted into float32), shape: same as input.
- Return type
-
Tensor. The output of Erf, dtype
Examples
>>> import paddle >>> x = paddle.to_tensor([-0.4, -0.2, 0.1, 0.3]) >>> out = paddle.erf(x) >>> print(out) Tensor(shape=[4], dtype=float32, place=Place(cpu), stop_gradient=True, [-0.42839241, -0.22270259, 0.11246292, 0.32862678])
