Skip to content

Error and related functions

beignet.special.error_erf

error_erf(input, *, out=None)

Error function.

Parameters:

Name Type Description Default
input Tensor

Input tensor.

required
out Tensor

Output tensor.

None

Returns:

Type Description
Tensor
Source code in src/beignet/special/_error_erf.py
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
def error_erf(input: Tensor, *, out: Tensor | None = None) -> Tensor:
    r"""
    Error function.

    Parameters
    ----------
    input : Tensor
        Input tensor.

    out : Tensor, optional
        Output tensor.

    Returns
    -------
    Tensor
    """
    output = 1.0 - error_erfc(input)

    if out is not None:
        out.copy_(output)

        return out

    return output

beignet.special.error_erfc

error_erfc(input, *, out=None)

Complementary error function.

Parameters:

Name Type Description Default
input Tensor

Input tensor.

required
out Tensor

Output tensor.

None

Returns:

Type Description
Tensor
Source code in src/beignet/special/_error_erfc.py
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
def error_erfc(input: Tensor, *, out: Tensor | None = None) -> Tensor:
    r"""
    Complementary error function.

    Parameters
    ----------
    input : Tensor
        Input tensor.

    out : Tensor, optional
        Output tensor.

    Returns
    -------
    Tensor
    """
    output = torch.exp(-(input**2)) * faddeeva_w(1.0j * input)

    if out is not None:
        out.copy_(output)

        return out

    return output

beignet.special.error_erfi

error_erfi(input, *, out=None)

Imaginary error function.

Parameters:

Name Type Description Default
input Tensor

Input tensor.

required
out Tensor

Output tensor.

None

Returns:

Type Description
Tensor
Source code in src/beignet/special/_error_erfi.py
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
def error_erfi(input: Tensor, *, out: Tensor | None = None) -> Tensor:
    r"""
    Imaginary error function.

    Parameters
    ----------
    input : Tensor
        Input tensor.

    out : Tensor, optional
        Output tensor.

    Returns
    -------
    Tensor
    """
    output = -1.0j * error_erf(1.0j * input)

    if out is not None:
        out.copy_(output)

        return out

    return output