o
    #j                     @   s  d dl mZ ddlmZ ddlmZ ddlmZmZ ddl	m
Z
mZmZmZ dd	d
Zg dZdgZg dZg Zede d< ede d< eeD ]ZeZeev rVee ZeeZee e< qJeeD ]ZeZeev rpee ZeeZee e< qdeeD ]ZeZeev ree ZeeZee_eeZee e< q~e
e d d e
e d d e
e d d e
e d d e
e d d e
e d d e
e d d dMd d!ZdMd"d#ZdMd$d%ZdMd&d'ZdMd(d)ZdMd*d+Z dMd,d-Z!dMd.d/Z"dMd0d1Z#dMd2d3Z$dMd4d5Z%dMd6d7Z&dMd8d9Z'dMd:d;Z(dMd<d=Z)dMd>d?Z*dMd@dAZ+dMdBdCZ,dMdDdEZ-dMdFdGZ.dMdHdIZ/edJZ0dMdKdJZ1dLe1_2dS )N    )inplace_apis_in_dygraph_only   )_C_ops)check_variable_and_dtype)LayerHelperin_dynamic_or_pir_mode   )add_sample_codegenerate_activation_fngenerate_inplace_fngenerate_layer_fnZ
tanhshrinkZlog_sigmoid)tanh_shrink
logsigmoid)silur   r   softplussoftsigntanhabs)Zexp_Zsqrt_Zrsqrt_Zceil_Zfloor_Zround_Zreciprocal_Zsigmoid_Zabs_Zsin_Zsinh_Zasin_Zasinh_Zcos_Zcosh_Zacos_Zacosh_Ztan_Zatan_Zatanh_Zexpm1_Zerf_Zsquare_scaleZ_scaleZelementwise_divZ_elementwise_divr   ab  
Examples:
    .. code-block:: python

        >>> import paddle
        >>> import paddle.nn.functional as F

        >>> x = paddle.to_tensor([1.0, 2.0, 3.0, 4.0])
        >>> out = F.silu(x)
        >>> print(out)
        Tensor(shape=[4], dtype=float32, place=Place(cpu), stop_gradient=True,
        [0.73105860, 1.76159406, 2.85772228, 3.92805505])
r   ao  
Examples:
    .. code-block:: python

        >>> import paddle
        >>> import paddle.nn.functional as F

        >>> x = paddle.to_tensor([-0.4, -0.2, 0.1, 0.3])
        >>> out = F.log_sigmoid(x)
        >>> print(out)
        Tensor(shape=[4], dtype=float32, place=Place(cpu), stop_gradient=True,
        [-0.91301525, -0.79813892, -0.64439666, -0.55435526])
r   a@  
Examples:
    .. code-block:: python

        >>> import paddle

        >>> x = paddle.to_tensor([-0.4, -0.2, 0.1, 0.3])
        >>> out = paddle.tanh(x)
        >>> print(out)
        Tensor(shape=[4], dtype=float32, place=Place(cpu), stop_gradient=True,
        [-0.37994900, -0.19737528,  0.09966799,  0.29131261])
r   an  
Examples:
    .. code-block:: python

        >>> import paddle
        >>> import paddle.nn.functional as F

        >>> x = paddle.to_tensor([-0.4, -0.2, 0.1, 0.3])
        >>> out = F.tanhshrink(x)
        >>> print(out)
        Tensor(shape=[4], dtype=float32, place=Place(cpu), stop_gradient=True,
        [-0.02005100, -0.00262472,  0.00033201,  0.00868741])
a;  
Examples:
    .. code-block:: python

        >>> import paddle

        >>> x = paddle.to_tensor([-0.4, -0.2, 0.1, 0.3])
        >>> out = paddle.abs(x)
        >>> print(out)
        Tensor(shape=[4], dtype=float32, place=Place(cpu), stop_gradient=True,
        [0.40000001, 0.20000000, 0.10000000, 0.30000001])
r   ah  
Examples:
    .. code-block:: python

        >>> import paddle
        >>> import paddle.nn.functional as F

        >>> x = paddle.to_tensor([-0.4, -0.2, 0.1, 0.3])
        >>> out = F.softplus(x)
        >>> print(out)
        Tensor(shape=[4], dtype=float32, place=Place(cpu), stop_gradient=True,
        [0.51301527, 0.59813893, 0.74439669, 0.85435522])
r   al  
Examples:
    .. code-block:: python

        >>> import paddle
        >>> import paddle.nn.functional as F

        >>> x = paddle.to_tensor([-0.4, -0.2, 0.1, 0.3])
        >>> out = F.softsign(x)
        >>> print(out)
        Tensor(shape=[4], dtype=float32, place=Place(cpu), stop_gradient=True,
        [-0.28571430, -0.16666666,  0.09090909,  0.23076925])
Nc                 C   \   t  rt| S t| dg dd td	i t }|j| jd}|jdd| id|id |S )
a  
    Acos Activation Operator.

    .. math::
        out = cos^{-1}(x)

    Args:
        x (Tensor): Input of Acos operator, an N-D Tensor, with data type float32, float64, float16, complex64 or complex128.
        name (str, optional): Name for the operation (optional, default is None). For more information, please refer to :ref:`api_guide_Name`.

    Returns:
        Tensor. Output of Acos operator, a Tensor with shape same as input.

    Examples:
        .. code-block:: python

            >>> import paddle

            >>> x = paddle.to_tensor([-0.4, -0.2, 0.1, 0.3])
            >>> out = paddle.acos(x)
            >>> print(out)
            Tensor(shape=[4], dtype=float32, place=Place(cpu), stop_gradient=True,
            [1.98231316, 1.77215421, 1.47062886, 1.26610363])
    xfloat16uint16float32float64	complex64
complex128acosdtypeXOuttypeZinputsZoutputsN)r   )	r   r   r   r   r   locals"create_variable_for_type_inferencer    	append_opr   namehelperout r,   R/var/www/html/Deteccion_Ine/venv/lib/python3.10/site-packages/paddle/tensor/ops.pyr         
r   c                 C   r   )
a  
    Acosh Activation Operator.

    .. math::
       out = acosh(x)

    Args:
        x (Tensor): Input of Acosh operator, an N-D Tensor, with data type float32, float64, float16, complex64 or complex128.
        name (str, optional): Name for the operation (optional, default is None). For more information, please refer to :ref:`api_guide_Name`.

    Returns:
        Tensor. Output of Acosh operator, a Tensor with shape same as input.

    Examples:
        .. code-block:: python

            >>> import paddle

            >>> x = paddle.to_tensor([1., 3., 4., 5.])
            >>> out = paddle.acosh(x)
            >>> print(out)
            Tensor(shape=[4], dtype=float32, place=Place(cpu), stop_gradient=True,
            [0.        , 1.76274717, 2.06343699, 2.29243159])
    r   r   acoshr   r!   r"   r#   N)r/   )	r   r   r/   r   r   r%   r&   r    r'   r(   r,   r,   r-   r/     r.   r/   c                 C   r   )
a  
    Arcsine Operator.

    .. math::
       out = sin^{-1}(x)

    Args:
        x (Tensor): Input of Asin operator, an N-D Tensor, with data type float32, float64, float16, complex64 or complex128.
        name (str, optional): Name for the operation (optional, default is None). For more information, please refer to :ref:`api_guide_Name`.

    Returns:
        Tensor. Same shape and dtype as input.

    Examples:
        .. code-block:: python

            >>> import paddle

            >>> x = paddle.to_tensor([-0.4, -0.2, 0.1, 0.3])
            >>> out = paddle.asin(x)
            >>> print(out)
            Tensor(shape=[4], dtype=float32, place=Place(cpu), stop_gradient=True,
            [-0.41151685, -0.20135793,  0.10016742,  0.30469266])
    r   r   asinr   r!   r"   r#   N)r0   )	r   r   r0   r   r   r%   r&   r    r'   r(   r,   r,   r-   r0   :  r.   r0   c                 C   r   )
a  
    Asinh Activation Operator.

    .. math::
       out = asinh(x)

    Args:
        x (Tensor): Input of Asinh operator, an N-D Tensor, with data type float32, float64, float16, complex64 or complex128.
        name (str, optional): Name for the operation (optional, default is None). For more information, please refer to :ref:`api_guide_Name`.

    Returns:
        Tensor. Output of Asinh operator, a Tensor with shape same as input.

    Examples:
        .. code-block:: python

            >>> import paddle

            >>> x = paddle.to_tensor([-0.4, -0.2, 0.1, 0.3])
            >>> out = paddle.asinh(x)
            >>> print(out)
            Tensor(shape=[4], dtype=float32, place=Place(cpu), stop_gradient=True,
            [-0.39003533, -0.19869010,  0.09983408,  0.29567307])
    r   r   asinhr   r!   r"   r#   N)r1   )	r   r   r1   r   r   r%   r&   r    r'   r(   r,   r,   r-   r1   i  r.   r1   c                 C   r   )
a  
    Arctangent Operator.

    .. math::
       out = tan^{-1}(x)

    Args:
        x (Tensor): Input of Atan operator, an N-D Tensor, with data type float32, float64, float16, complex64 or complex128.
        name (str, optional): Name for the operation (optional, default is None). For more information, please refer to :ref:`api_guide_Name`.

    Returns:
        Tensor. Same shape and dtype as input x.

    Examples:
        .. code-block:: python

            >>> import paddle

            >>> x = paddle.to_tensor([-0.4, -0.2, 0.1, 0.3])
            >>> out = paddle.atan(x)
            >>> print(out)
            Tensor(shape=[4], dtype=float32, place=Place(cpu), stop_gradient=True,
            [-0.38050640, -0.19739556,  0.09966865,  0.29145682])
    r   r   atanr   r!   r"   r#   N)r2   )	r   r   r2   r   r   r%   r&   r    r'   r(   r,   r,   r-   r2     r.   r2   c                 C   r   )
a  
    Atanh Activation Operator.

    .. math::
       out = atanh(x)

    Args:
        x (Tensor): Input of Atan operator, an N-D Tensor, with data type float32, float64, float16, complex64 or complex128.
        name (str, optional): Name for the operation (optional, default is None). For more information, please refer to :ref:`api_guide_Name`.

    Returns:
        Tensor. Output of Atanh operator, a Tensor with shape same as input.

    Examples:
        .. code-block:: python

            >>> import paddle

            >>> x = paddle.to_tensor([-0.4, -0.2, 0.1, 0.3])
            >>> out = paddle.atanh(x)
            >>> print(out)
            Tensor(shape=[4], dtype=float32, place=Place(cpu), stop_gradient=True,
            [-0.42364895, -0.20273255,  0.10033534,  0.30951962])
    r   r   atanhr   r!   r"   r#   N)r3   )	r   r   r3   r   r   r%   r&   r    r'   r(   r,   r,   r-   r3     r.   r3   c                 C   r   )
a  

    Ceil Operator. Computes ceil of x element-wise.

    .. math::
        out = \left \lceil x \right \rceil

    Args:
        x (Tensor): Input of Ceil operator, an N-D Tensor, with data type float32, float64 or float16.
        name (str, optional): Name for the operation (optional, default is None). For more information, please refer to :ref:`api_guide_Name`.

    Returns:
        Tensor. Output of Ceil operator, a Tensor with shape same as input.

    Examples:
        .. code-block:: python

            >>> import paddle

            >>> x = paddle.to_tensor([-0.4, -0.2, 0.1, 0.3])
            >>> out = paddle.ceil(x)
            >>> print(out)
            Tensor(shape=[4], dtype=float32, place=Place(cpu), stop_gradient=True,
            [-0., -0., 1. , 1. ])
    r   r   r   r   r   ceilr   r!   r"   r#   N)r5   )	r   r   r5   r   r   r%   r&   r    r'   r(   r,   r,   r-   r5        
r5   c                 C   r   )
aT  
    Cosine Operator. Computes cosine of x element-wise.

    Input range is `(-inf, inf)` and output range is `[-1,1]`.

    .. math::
       out = cos(x)

    Args:
        x (Tensor): Input of Cos operator, an N-D Tensor, with data type float32, float64 or float16.
        name (str, optional): Name for the operation (optional, default is None). For more information, please refer to :ref:`api_guide_Name`.

    Returns:
        Tensor. Output of Cos operator, a Tensor with shape same as input.

    Examples:
        .. code-block:: python

            >>> import paddle

            >>> x = paddle.to_tensor([-0.4, -0.2, 0.1, 0.3])
            >>> out = paddle.cos(x)
            >>> print(out)
            Tensor(shape=[4], dtype=float32, place=Place(cpu), stop_gradient=True,
            [0.92106098, 0.98006660, 0.99500418, 0.95533651])
    r   )r   r   r   r   r   cosr   r!   r"   r#   N)r7   )	r   r   r7   r   r   r%   r&   r    r'   r(   r,   r,   r-   r7     s   
r7   c                 C   r   )
a_  
    Cosh Activation Operator.

    Input range `(-inf, inf)`, output range `(1, inf)`.

    .. math::
       out = \frac{exp(x)+exp(-x)}{2}

    Args:
        x (Tensor): Input of Cosh operator, an N-D Tensor, with data type float32, float64, float16, complex64 or complex128.
        name (str, optional): Name for the operation (optional, default is None). For more information, please refer to :ref:`api_guide_Name`.

    Returns:
        Tensor. Output of Cosh operator, a Tensor with shape same as input.

    Examples:
        .. code-block:: python

            >>> import paddle

            >>> x = paddle.to_tensor([-0.4, -0.2, 0.1, 0.3])
            >>> out = paddle.cosh(x)
            >>> print(out)
            Tensor(shape=[4], dtype=float32, place=Place(cpu), stop_gradient=True,
            [1.08107233, 1.02006674, 1.00500417, 1.04533851])
    r   r   coshr   r!   r"   r#   N)r8   )	r   r   r8   r   r   r%   r&   r    r'   r(   r,   r,   r-   r8   F     
r8   c                 C   r   )
aJ  

    Computes exp of x element-wise with a natural number `e` as the base.

    .. math::
        out = e^x

    Args:
        x (Tensor): Input of Exp operator, an N-D Tensor, with data type int32, int64, float16, float32, float64, complex64 or complex128.
        name (str, optional): Name for the operation (optional, default is None). For more information, please refer to :ref:`api_guide_Name`.

    Returns:
        Tensor. Output of Exp operator, a Tensor with shape same as input.

    Examples:
        .. code-block:: python

            >>> import paddle

            >>> x = paddle.to_tensor([-0.4, -0.2, 0.1, 0.3])
            >>> out = paddle.exp(x)
            >>> print(out)
            Tensor(shape=[4], dtype=float32, place=Place(cpu), stop_gradient=True,
            [0.67032003, 0.81873077, 1.10517097, 1.34985888])
    r   )int32int64r   r   r   r   r   r   expr   r!   r"   r#   N)r<   )	r   r   r<   r   r   r%   r&   r    r'   r(   r,   r,   r-   r<   w     

r<   c                 C   r   )
ap  

    Expm1 Operator. Computes expm1 of x element-wise with a natural number :math:`e` as the base.

    .. math::
        out = e^x - 1

    Args:
        x (Tensor): Input of Expm1 operator, an N-D Tensor, with data type int32, int64, float16, float32, float64, complex64 or complex128.
        name (str, optional): Name for the operation (optional, default is None). For more information, please refer to :ref:`api_guide_Name`.

    Returns:
        Tensor. Output of Expm1 operator, a Tensor with shape same as input.

    Examples:
        .. code-block:: python

            >>> import paddle

            >>> x = paddle.to_tensor([-0.4, -0.2, 0.1, 0.3])
            >>> out = paddle.expm1(x)
            >>> print(out)
            Tensor(shape=[4], dtype=float32, place=Place(cpu), stop_gradient=True,
            [-0.32967997, -0.18126924,  0.10517092,  0.34985882])
    r   )r   r   r   r   r:   r;   r   r   expm1r   r!   r"   r#   N)r>   )	r   r   r>   r   r   r%   r&   r    r'   r(   r,   r,   r-   r>     r=   r>   c                 C   r   )
a  

    Floor Activation Operator. Computes floor of x element-wise.

    .. math::
        out = \lfloor x \rfloor

    Args:
        x (Tensor): Input of Floor operator, an N-D Tensor, with data type float32, float64 or float16.
        name (str, optional): Name for the operation (optional, default is None). For more information, please refer to :ref:`api_guide_Name`.

    Returns:
        Tensor. Output of Floor operator, a Tensor with shape same as input.

    Examples:
        .. code-block:: python

            >>> import paddle

            >>> x = paddle.to_tensor([-0.4, -0.2, 0.1, 0.3])
            >>> out = paddle.floor(x)
            >>> print(out)
            Tensor(shape=[4], dtype=float32, place=Place(cpu), stop_gradient=True,
            [-1., -1.,  0.,  0.])
    r   r4   floorr   r!   r"   r#   N)r?   )	r   r   r?   r   r   r%   r&   r    r'   r(   r,   r,   r-   r?     r6   r?   c                 C   r   )
a   

    Reciprocal Activation Operator.

    .. math::
        out = \frac{1}{x}

    Args:
        x (Tensor): Input of Reciprocal operator, an N-D Tensor, with data type float32, float64 or float16.
        name (str, optional): Name for the operation (optional, default is None). For more information, please refer to :ref:`api_guide_Name`.

    Returns:
        Tensor. Output of Reciprocal operator, a Tensor with shape same as input.

    Examples:
        .. code-block:: python

            >>> import paddle

            >>> x = paddle.to_tensor([-0.4, -0.2, 0.1, 0.3])
            >>> out = paddle.reciprocal(x)
            >>> print(out)
            Tensor(shape=[4], dtype=float32, place=Place(cpu), stop_gradient=True,
            [-2.50000000, -5.        ,  10.       ,  3.33333325])
    r   r4   
reciprocalr   r!   r"   r#   N)r@   )	r   r   r@   r   r   r%   r&   r    r'   r(   r,   r,   r-   r@     s   
r@   c                 C   r   )
a  

    Round the values in the input to the nearest integer value.

    .. code-block:: text

        input:
          x.shape = [4]
          x.data = [1.2, -0.9, 3.4, 0.9]

        output:
          out.shape = [4]
          out.data = [1., -1., 3., 1.]

    Args:
        x (Tensor): Input of Round operator, an N-D Tensor, with data type float32, float64 or float16.
        name (str, optional): Name for the operation (optional, default is None). For more information, please refer to :ref:`api_guide_Name`.

    Returns:
        Tensor. Output of Round operator, a Tensor with shape same as input.

    Examples:
        .. code-block:: python

            >>> import paddle

            >>> x = paddle.to_tensor([-0.5, -0.2, 0.6, 1.5])
            >>> out = paddle.round(x)
            >>> print(out)
            Tensor(shape=[4], dtype=float32, place=Place(cpu), stop_gradient=True,
            [-1., -0.,  1.,  2.])
    r   r4   roundr   r!   r"   r#   N)rA   )	r   r   rA   r   r   r%   r&   r    r'   r(   r,   r,   r-   rA   )  s   !
rA   c                 C   r   )
aK  
    Rsqrt Activation Operator.

    Please make sure input is legal in case of numeric errors.

    .. math::
       out = \frac{1}{\sqrt{x}}

    Args:
        x (Tensor): Input of Rsqrt operator, an N-D Tensor, with data type float32, float64 or float16.
        name (str, optional): Name for the operation (optional, default is None). For more information, please refer to :ref:`api_guide_Name`.

    Returns:
        Tensor. Output of Rsqrt operator, a Tensor with shape same as input.

    Examples:
        .. code-block:: python

            >>> import paddle

            >>> x = paddle.to_tensor([0.1, 0.2, 0.3, 0.4])
            >>> out = paddle.rsqrt(x)
            >>> print(out)
            Tensor(shape=[4], dtype=float32, place=Place(cpu), stop_gradient=True,
            [3.16227770, 2.23606801, 1.82574177, 1.58113885])
    r   r4   rsqrtr   r!   r"   r#   N)rB   )	r   r   rB   r   r   r%   r&   r    r'   r(   r,   r,   r-   rB   V  s   
rB   c                 C   r   )
aQ  
    Sigmoid Activation.

    .. math::
       out = \frac{1}{1 + e^{-x}}

    Args:
        x (Tensor): Input of Sigmoid operator, an N-D Tensor, with data type float16, float32, float64, complex64 or complex128.
        name (str, optional): Name for the operation (optional, default is None). For more information, please refer to :ref:`api_guide_Name`.

    Returns:
        Tensor. Output of Sigmoid operator, a Tensor with shape same as input.

    Examples:
        .. code-block:: python

            >>> import paddle
            >>> import paddle.nn.functional as F

            >>> x = paddle.to_tensor([-0.4, -0.2, 0.1, 0.3])
            >>> out = F.sigmoid(x)
            >>> print(out)
            Tensor(shape=[4], dtype=float32, place=Place(cpu), stop_gradient=True,
            [0.40131235, 0.45016602, 0.52497917, 0.57444251])
    r   )r   r   r   r   r   r   sigmoidr   r!   r"   r#   N)rC   )	r   r   rC   r   r   r%   r&   r    r'   r(   r,   r,   r-   rC   }  s   
rC   c                 C   r   )
a  
    Sine Activation Operator.

    .. math::
       out = sin(x)

    Args:
        x (Tensor): Input of Sin operator, an N-D Tensor, with data type float32, float64 or float16.
        name (str, optional): Name for the operation (optional, default is None). For more information, please refer to :ref:`api_guide_Name`.

    Returns:
        Tensor. Output of Sin operator, a Tensor with shape same as input.

    Examples:
        .. code-block:: python

            >>> import paddle

            >>> x = paddle.to_tensor([-0.4, -0.2, 0.1, 0.3])
            >>> out = paddle.sin(x)
            >>> print(out)
            Tensor(shape=[4], dtype=float32, place=Place(cpu), stop_gradient=True,
            [-0.38941833, -0.19866933,  0.09983342,  0.29552022])
    r   r   sinr   r!   r"   r#   N)rD   )	r   r   rD   r   r   r%   r&   r    r'   r(   r,   r,   r-   rD     r.   rD   c                 C   r   )
a  
    Sinh Activation Operator.

    .. math::
       out = sinh(x)

    Args:
        x (Tensor): Input of Sinh operator, an N-D Tensor, with data type float32, float64, float16, complex64 or complex128.
        name (str, optional): Name for the operation (optional, default is None). For more information, please refer to :ref:`api_guide_Name`.

    Returns:
        Tensor. Output of Sinh operator, a Tensor with shape same as input.

    Examples:
        .. code-block:: python

            >>> import paddle

            >>> x = paddle.to_tensor([-0.4, -0.2, 0.1, 0.3])
            >>> out = paddle.sinh(x)
            >>> print(out)
            Tensor(shape=[4], dtype=float32, place=Place(cpu), stop_gradient=True,
            [-0.41075233, -0.20133601,  0.10016675,  0.30452031])
    r   r   sinhr   r!   r"   r#   N)rE   )	r   r   rE   r   r   r%   r&   r    r'   r(   r,   r,   r-   rE     r.   rE   c                 C   r   )
a  
    Sqrt Activation Operator.

    .. math::
       out=\sqrt{x}=x^{1/2}

    Args:
        x (Tensor): Input of Sqrt operator, an N-D Tensor, with data type float32, float64 or float16.
        name (str, optional): Name for the operation (optional, default is None). For more information, please refer to :ref:`api_guide_Name`.

    Returns:
        Tensor. Output of Sqrt operator, a Tensor with shape same as input.

    Examples:
        .. code-block:: python

            >>> import paddle

            >>> x = paddle.to_tensor([0.1, 0.2, 0.3, 0.4])
            >>> out = paddle.sqrt(x)
            >>> print(out)
            Tensor(shape=[4], dtype=float32, place=Place(cpu), stop_gradient=True,
            [0.31622776, 0.44721359, 0.54772258, 0.63245553])
    r   r4   sqrtr   r!   r"   r#   N)rF   )	r   r   rF   r   r   r%   r&   r    r'   r(   r,   r,   r-   rF     s   
rF   c                 C   r   )
a
  
    Square each elements of the inputs.

    .. math::
       out = x^2

    Args:
        x (Tensor): Input of Square operator, an N-D Tensor, with data type float32, float64 or float16.
        name (str, optional): Name for the operation (optional, default is None). For more information, please refer to :ref:`api_guide_Name`.

    Returns:
        Tensor. Output of Square operator, a Tensor with shape same as input.

    Examples:
        .. code-block:: python

            >>> import paddle

            >>> x = paddle.to_tensor([-0.4, -0.2, 0.1, 0.3])
            >>> out = paddle.square(x)
            >>> print(out)
            Tensor(shape=[4], dtype=float32, place=Place(cpu), stop_gradient=True,
            [0.16000001, 0.04000000, 0.01000000, 0.09000000])
    r   )r:   r;   r   r   r   r   r   squarer   r!   r"   r#   N)rG   )	r   r   rG   r   r   r%   r&   r    r'   r(   r,   r,   r-   rG   3  s   
	rG   c                 C   r   )
aj  
    Tangent Operator. Computes tangent of x element-wise.

    Input range is `(k*pi-pi/2, k*pi+pi/2)` and output range is `(-inf, inf)`.

    .. math::
       out = tan(x)

    Args:
        x (Tensor): Input of Tan operator, an N-D Tensor, with data type float32, float64 or float16.
        name (str, optional): Name for the operation (optional, default is None). For more information, please refer to :ref:`api_guide_Name`.

    Returns:
        Tensor. Output of Tan operator, a Tensor with shape same as input.

    Examples:
        .. code-block:: python

            >>> import paddle

            >>> x = paddle.to_tensor([-0.4, -0.2, 0.1, 0.3])
            >>> out = paddle.tan(x)
            >>> print(out)
            Tensor(shape=[4], dtype=float32, place=Place(cpu), stop_gradient=True,
            [-0.42279324, -0.20271003,  0.10033467,  0.30933627])
    r   r   tanr   r!   r"   r#   N)rH   )	r   r   rH   r   r   r%   r&   r    r'   r(   r,   r,   r-   rH   c  r9   rH   erfc                 C   sN   t  rt| S t  }i }| D ]\}}|d ur|||< qtdi |S )Nr,   )r   r   rI   r%   copyitems_erf_)r   r)   Z
locals_varkwargsvalr,   r,   r-   rI     s   

ag  
:strong:`Erf Operator`
For more details, see `Error function <https://en.wikipedia.org/wiki/Error_function>`_.

Equation:
    ..  math::
        out = \frac{2}{\sqrt{\pi}} \int_{0}^{x}e^{- \eta^{2}}d\eta

Args:

    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 :ref:`api_guide_Name`.

Returns:

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

Examples:

    .. code-block:: python

        >>> 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])
)N)3Zpaddle.utils.inplace_utilsr    r   Zbase.data_feederr   Z	frameworkr   r   Zlayer_function_generatorr	   r
   r   r   Z__deprecated_func_name__Z__activations_noattr__Z__unary_func__Z__inplace_unary_func____all__globalssetZ_OPZ_new_OPZ_funcfunc__name__
__module__r   r/   r0   r1   r2   r3   r5   r7   r8   r<   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   rL   rI   __doc__r,   r,   r,   r-   <module>   s   	

/
/
/
/
/
/
&
*
1
2
2
&
(
-
'
0
/
/
(
01

