oneflow.erfc

oneflow.erfc()

Computes the complementary error function of each element of input. The complementary error function is defined as follows:

\[\operatorname{erfc}(x)=1-\frac{2}{\sqrt{\pi}} \int_{0}^{x} e^{-t^{2}} d t\]
Parameters

x (oneflow.Tensor) – A Tensor

Returns

The result Tensor

Return type

oneflow.Tensor

For example:

>>> import oneflow as flow
>>> import numpy as np

>>> x = flow.tensor(np.array([0, -1., 10.]), dtype=flow.float32)
>>> out = flow.erfc(x)
>>> out
tensor([1.0000e+00, 1.8427e+00, 2.8026e-45], dtype=oneflow.float32)

>>> x = flow.tensor(np.array([[0, -1., 10.], [5, 7, 0.8]]), dtype=flow.float32)
>>> out = flow.erfc(x)
>>> out
tensor([[1.0000e+00, 1.8427e+00, 2.8026e-45],
        [1.5375e-12, 4.1838e-23, 2.5790e-01]], dtype=oneflow.float32)