Ë
    –\;j_�  ã                   óŠ  — 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 ree   Z ee«      Ze e«       e<   Œ!  ee«      D ]  ZeZeev ree   Z ee«      Ze e«       e<   Œ!  ee«      D ].  ZeZeev ree   Z ee«      Zee_         ee«      Ze e«       e<   Œ0  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«       d8d „Zd8d!„Zd8d"„Zd8d#„Zd8d$„Zd8d%„Z d8d&„Z!d8d'„Z"d8d(„Z#d8d)„Z$d8d*„Z%d8d+„Z&d8d,„Z'd8d-„Z(d8d.„Z)d8d/„Z*d8d0„Z+d8d1„Z,d8d2„Z-d8d3„Z.d8d4„Z/ ed5«      Z0d8d6„Z1d7e1_2        y)9é    )Ú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_fnÚ
tanhshrinkÚlog_sigmoid)Útanh_shrinkÚ
logsigmoid)Úsilur   r   ÚsoftplusÚsoftsignÚtanhÚabs)Úexp_Úsqrt_Úrsqrt_Úceil_Úfloor_Úround_Úreciprocal_Úsigmoid_Úabs_Úsin_Úsinh_Úasin_Úasinh_Úcos_Úcosh_Úacos_Úacosh_Útan_Úatan_Úatanh_Úexpm1_Úerf_Úsquare_ÚscaleÚ_scaleÚelementwise_divÚ_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                 óò   — t        «       rt        j                  | «      S t        | dg d¢d«       t	        di t        «       ¤Ž}|j                  | j                  ¬«      }|j                  dd| id|i¬«       |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©ÚtypeÚinputsÚoutputs)r;   )	r   r   r;   r   r   ÚlocalsÚ"create_variable_for_type_inferencer=   Ú	append_op©r3   ÚnameÚhelperÚouts       úZG:\00. PROJECTS\API\Inventory\templateJSON\kerjaOCR\Lib\site-packages\paddle/tensor/ops.pyr;   r;   Ü   óz   € ô2 ÔÜ�{‰{˜1‹~Ðä ØØòð ô	
ô Ñ0¤v£xÑ0ˆØ×7Ñ7¸a¿g¹gÐ7ÓFˆØ×Ñ˜f¨c°1¨XÀÀs¸|ÐÔLØˆ
ó    c                 óò   — t        «       rt        j                  | «      S t        | dg d¢d«       t	        di t        «       ¤Ž}|j                  | j                  ¬«      }|j                  dd| id|i¬«       |S )	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])
    r3   r4   Úacoshr<   r>   r?   r@   )rO   )	r   r   rO   r   r   rD   rE   r=   rF   rG   s       rK   rO   rO     óz   € ô2 ÔÜ�|‰|˜A‹Ðä ØØòð ô	
ô Ñ1¬«Ñ1ˆØ×7Ñ7¸a¿g¹gÐ7ÓFˆØ×Ñ˜g¨s°A¨hÀÈÀÐÔMØˆ
rM   c                 óò   — t        «       rt        j                  | «      S t        | dg d¢d«       t	        di t        «       ¤Ž}|j                  | j                  ¬«      }|j                  dd| id|i¬«       |S )	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])
    r3   r4   Úasinr<   r>   r?   r@   )rR   )	r   r   rR   r   r   rD   rE   r=   rF   rG   s       rK   rR   rR   :  rL   rM   c                 óò   — t        «       rt        j                  | «      S t        | dg d¢d«       t	        di t        «       ¤Ž}|j                  | j                  ¬«      }|j                  dd| id|i¬«       |S )	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])
    r3   r4   Úasinhr<   r>   r?   r@   )rT   )	r   r   rT   r   r   rD   rE   r=   rF   rG   s       rK   rT   rT   i  rP   rM   c                 óò   — t        «       rt        j                  | «      S t        | dg d¢d«       t	        di t        «       ¤Ž}|j                  | j                  ¬«      }|j                  dd| id|i¬«       |S )	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])
    r3   r4   Úatanr<   r>   r?   r@   )rV   )	r   r   rV   r   r   rD   rE   r=   rF   rG   s       rK   rV   rV   ˜  rL   rM   c                 óò   — t        «       rt        j                  | «      S t        | dg d¢d«       t	        di t        «       ¤Ž}|j                  | j                  ¬«      }|j                  dd| id|i¬«       |S )	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])
    r3   r4   Úatanhr<   r>   r?   r@   )rX   )	r   r   rX   r   r   rD   rE   r=   rF   rG   s       rK   rX   rX   Ç  rP   rM   c                 óò   — t        «       rt        j                  | «      S t        | dg d¢d«       t	        di t        «       ¤Ž}|j                  | j                  ¬«      }|j                  dd| id|i¬«       |S )	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. ])
    r3   ©r5   r6   r7   r8   Úceilr<   r>   r?   r@   )r[   )	r   r   r[   r   r   rD   rE   r=   rF   rG   s       rK   r[   r[   ö  st   € ô4 ÔÜ�{‰{˜1‹~Ðä ØˆsÒ?Àô	
ô Ñ0¤v£xÑ0ˆØ×7Ñ7¸a¿g¹gÐ7ÓFˆØ×Ñ˜f¨c°1¨XÀÀs¸|ÐÔLØˆ
rM   c                 óò   — t        «       rt        j                  | «      S t        | dg d¢d«       t	        di t        «       ¤Ž}|j                  | j                  ¬«      }|j                  dd| id|i¬«       |S )	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])
    r3   )r5   r7   r8   r9   r:   Úcosr<   r>   r?   r@   )r]   )	r   r   r]   r   r   rD   rE   r=   rF   rG   s       rK   r]   r]     sv   € ô6 ÔÜ�z‰z˜!‹}Ðä ØØÚHØô		
ô Ñ/¤f£hÑ/ˆØ×7Ñ7¸a¿g¹gÐ7ÓFˆØ×Ñ˜e¨S°!¨H¸uÀc¸lÐÔKØˆ
rM   c                 óò   — t        «       rt        j                  | «      S t        | dg d¢d«       t	        di t        «       ¤Ž}|j                  | j                  ¬«      }|j                  dd| id|i¬«       |S )	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])
    r3   r4   Úcoshr<   r>   r?   r@   )r_   )	r   r   r_   r   r   rD   rE   r=   rF   rG   s       rK   r_   r_   F  sz   € ô6 ÔÜ�{‰{˜1‹~Ðä ØØòð ô	
ô Ñ0¤v£xÑ0ˆØ×7Ñ7¸a¿g¹gÐ7ÓFˆØ×Ñ˜f¨c°1¨XÀÀs¸|ÐÔLØˆ
rM   c                 óò   — t        «       rt        j                  | «      S t        | dg d¢d«       t	        di t        «       ¤Ž}|j                  | j                  ¬«      }|j                  dd| id|i¬«       |S )	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])
    r3   )Úint32Úint64r6   r5   r7   r8   r9   r:   Úexpr<   r>   r?   r@   )rc   )	r   r   rc   r   r   rD   rE   r=   rF   rG   s       rK   rc   rc   w  sz   € ô4 ÔÜ�z‰z˜!‹}Ðä ØØò	ð ô	
ô Ñ/¤f£hÑ/ˆØ×7Ñ7¸a¿g¹gÐ7ÓFˆØ×Ñ˜e¨S°!¨H¸uÀc¸lÐÔKØˆ
rM   c                 óò   — t        «       rt        j                  | «      S t        | dg d¢d«       t	        di t        «       ¤Ž}|j                  | j                  ¬«      }|j                  dd| id|i¬«       |S )	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])
    r3   )r5   r6   r7   r8   ra   rb   r9   r:   Úexpm1r<   r>   r?   r@   )re   )	r   r   re   r   r   rD   rE   r=   rF   rG   s       rK   re   re   ©  sz   € ô4 ÔÜ�|‰|˜A‹Ðä ØØò	ð ô	
ô Ñ1¬«Ñ1ˆØ×7Ñ7¸a¿g¹gÐ7ÓFˆØ×Ñ˜g¨s°A¨hÀÈÀÐÔMØˆ
rM   c                 óò   — t        «       rt        j                  | «      S t        | dg d¢d«       t	        di t        «       ¤Ž}|j                  | j                  ¬«      }|j                  dd| id|i¬«       |S )	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.])
    r3   rZ   Úfloorr<   r>   r?   r@   )rg   )	r   r   rg   r   r   rD   rE   r=   rF   rG   s       rK   rg   rg   Û  st   € ô4 ÔÜ�|‰|˜A‹Ðä ØˆsÒ?Àô	
ô Ñ1¬«Ñ1ˆØ×7Ñ7¸a¿g¹gÐ7ÓFˆØ×Ñ˜g¨s°A¨hÀÈÀÐÔMØˆ
rM   c                 óò   — t        «       rt        j                  | «      S t        | dg d¢d«       t	        di t        «       ¤Ž}|j                  | j                  ¬«      }|j                  dd| id|i¬«       |S )	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])
    r3   rZ   Ú
reciprocalr<   r>   r?   r@   )ri   )	r   r   ri   r   r   rD   rE   r=   rF   rG   s       rK   ri   ri     s~   € ô4 ÔÜ× Ñ  Ó#Ð#ä ØˆsÒ?Àô	
ô Ñ6¬V«XÑ6ˆØ×7Ñ7¸a¿g¹gÐ7ÓFˆØ×ÑØ s¨A h¸À¸ð 	ô 	
ð ˆ
rM   c                 óò   — t        «       rt        j                  | «      S t        | dg d¢d«       t	        di t        «       ¤Ž}|j                  | j                  ¬«      }|j                  dd| id|i¬«       |S )	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.])
    r3   rZ   Úroundr<   r>   r?   r@   )rk   )	r   r   rk   r   r   rD   rE   r=   rF   rG   s       rK   rk   rk   )  su   € ôB ÔÜ�|‰|˜A‹Ðä ØˆsÒ?Àô	
ô Ñ1¬«Ñ1ˆØ×7Ñ7¸a¿g¹gÐ7ÓFˆØ×Ñ˜g¨s°A¨hÀÈÀÐÔMØˆ
rM   c                 óò   — t        «       rt        j                  | «      S t        | dg d¢d«       t	        di t        «       ¤Ž}|j                  | j                  ¬«      }|j                  dd| id|i¬«       |S )	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])
    r3   rZ   Úrsqrtr<   r>   r?   r@   )rm   )	r   r   rm   r   r   rD   rE   r=   rF   rG   s       rK   rm   rm   V  st   € ô6 ÔÜ�|‰|˜A‹Ðä ØˆsÒ?Àô	
ô Ñ1¬«Ñ1ˆØ×7Ñ7¸a¿g¹gÐ7ÓFˆØ×Ñ˜g¨s°A¨hÀÈÀÐÔMØˆ
rM   c                 óò   — t        «       rt        j                  | «      S t        | dg d¢d«       t	        di t        «       ¤Ž}|j                  | j                  ¬«      }|j                  dd| id|i¬«       |S )	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])
    r3   )r5   r7   r8   r6   r9   r:   Úsigmoidr<   r>   r?   r@   )ro   )	r   r   ro   r   r   rD   rE   r=   rF   rG   s       rK   ro   ro   }  s{   € ô4 ÔÜ�~‰~˜aÓ Ð ä ØØòð ô	
ô Ñ3¬&«(Ñ3ˆØ×7Ñ7¸a¿g¹gÐ7ÓFˆØ×Ñ˜i°°a°À5È#À,ÐÔOØˆ
rM   c                 óò   — t        «       rt        j                  | «      S t        | dg d¢d«       t	        di t        «       ¤Ž}|j                  | j                  ¬«      }|j                  dd| id|i¬«       |S )	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])
    r3   r4   Úsinr<   r>   r?   r@   )rq   )	r   r   rq   r   r   rD   rE   r=   rF   rG   s       rK   rq   rq   ­  sz   € ô2 ÔÜ�z‰z˜!‹}Ðä ØØòð ô	
ô Ñ/¤f£hÑ/ˆØ×7Ñ7¸a¿g¹gÐ7ÓFˆØ×Ñ˜e¨S°!¨H¸uÀc¸lÐÔKØˆ
rM   c                 óò   — t        «       rt        j                  | «      S t        | dg d¢d«       t	        di t        «       ¤Ž}|j                  | j                  ¬«      }|j                  dd| id|i¬«       |S )	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])
    r3   r4   Úsinhr<   r>   r?   r@   )rs   )	r   r   rs   r   r   rD   rE   r=   rF   rG   s       rK   rs   rs   Ü  rL   rM   c                 óò   — t        «       rt        j                  | «      S t        | dg d¢d«       t	        di t        «       ¤Ž}|j                  | j                  ¬«      }|j                  dd| id|i¬«       |S )	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])
    r3   rZ   Úsqrtr<   r>   r?   r@   )ru   )	r   r   ru   r   r   rD   rE   r=   rF   rG   s       rK   ru   ru     sv   € ô2 ÔÜ�{‰{˜1‹~Ðä ØØÚ7Øô		
ô Ñ0¤v£xÑ0ˆØ×7Ñ7¸a¿g¹gÐ7ÓFˆØ×Ñ˜f¨c°1¨XÀÀs¸|ÐÔLØˆ
rM   c                 óò   — t        «       rt        j                  | «      S t        | dg d¢d«       t	        di t        «       ¤Ž}|j                  | j                  ¬«      }|j                  dd| id|i¬«       |S )	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])
    r3   )ra   rb   r5   r7   r8   r9   r:   Úsquarer<   r>   r?   r@   )rw   )	r   r   rw   r   r   rD   rE   r=   rF   rG   s       rK   rw   rw   3  s{   € ô2 ÔÜ�}‰}˜QÓÐä ØØòð ô	
ô Ñ2¬«Ñ2ˆØ×7Ñ7¸a¿g¹gÐ7ÓFˆØ×Ñ˜h°°Q¨xÀ%ÈÀÐÔNØˆ
rM   c                 óò   — t        «       rt        j                  | «      S t        | dg d¢d«       t	        di t        «       ¤Ž}|j                  | j                  ¬«      }|j                  dd| id|i¬«       |S )	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])
    r3   r4   Útanr<   r>   r?   r@   )ry   )	r   r   ry   r   r   rD   rE   r=   rF   rG   s       rK   ry   ry   c  sz   € ô6 ÔÜ�z‰z˜!‹}Ðä ØØòð ô	
ô Ñ/¤f£hÑ/ˆØ×7Ñ7¸a¿g¹gÐ7ÓFˆØ×Ñ˜e¨S°!¨H¸uÀc¸lÐÔKØˆ
rM   Úerfc                 óÊ   — t        «       rt        j                  | «      S t        «       j	                  «       }i }|j                  «       D ]  \  }}|€Œ	|||<   Œ t        di |¤ŽS )N© )r   r   rz   rD   ÚcopyÚitemsÚ_erf_)r3   rH   Ú
locals_varÚkwargsÚvals        rK   rz   rz   —  s[   € ÜÔÜ�z‰z˜!‹}Ðä“—‘“€JØ€FØ×%Ñ%Ö'‰	ˆˆcØ‰?ØˆF�4ŠLð (ô ‰?�6‰?ÐrM   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)3Úpaddle.utils.inplace_utilsr   Ú r   Úbase.data_feederr   Ú	frameworkr   r   Úlayer_function_generatorr
   r   r   r   Ú__deprecated_func_name__Ú__activations_noattr__Ú__unary_func__Ú__inplace_unary_func__Ú__all__ÚglobalsÚsetÚ_OPÚ_new_OPÚ_funcÚfuncÚ__name__Ú
__module__r;   rO   rR   rT   rV   rX   r[   r]   r_   rc   re   rg   ri   rk   rm   ro   rq   rs   ru   rw   ry   r   rz   Ú__doc__r|   rM   rK   Ú<module>r–      s†  ðõ  Då Ý 7ß ;÷ó ð  ØñÐ ò
Ð ð �€òÐ ð4 €ñ
 (¨Ó0�ƒ	ˆ(Ñ á 1Ð2CÓ D�ƒ	Ð
Ñ áÐ%Ö&€CØ€GØ
Ð&Ñ&Ø*¨3Ñ/ˆÙ" 3Ó'€EØ�GƒIˆc‚Nð 'ñ ˆ~Ö€CØ€GØ
Ð&Ñ&Ø*¨3Ñ/ˆÙ" 3Ó'€EØ�GƒIˆc‚Nð ñ Ð%Ö&€CØ€GØ
Ð&Ñ&Ø*¨3Ñ/ˆÙ˜sÓ#€DØ€D„OÙ(¨Ó.€EØ�GƒIˆc‚Nð 'ñ ÙƒIˆfÑðôñ" ÙƒIˆlÑðôñ" ÙƒIˆfÑðôñ  ÙƒIˆmÑðôñ" ÙƒIˆeÑðôñ  ÙƒIˆjÑðôñ" ÙƒIˆjÑðôó$,ó^,ó^,ó^,ó^,ó^,ó^#óL'óT.ób/ód/ód#óL%óP*óZ$óN-ó`,ó^,ó^%óP-ó`.ñb 	˜%Ó €ó	ð€…rM   