§
    x-j	  ã                  óˆ   — d dl mZ d dlmZ d dlmZ d dlmZ ddlm	Z	 erd dlm
Z
  edd	d
d¬¦  «        	 ddd„¦   «         ZdS )é    )Úannotations)ÚTYPE_CHECKING)Ú_C_ops)Ú
deprecatedé   )Úin_dynamic_or_pir_mode)ÚTensorz3.3.0zpaddle.nn.functional.swiglué   zopaddle.incubate.nn.functional.swiglu will be removed in future. Please use paddle.nn.functional.swiglu instead.)ÚsinceÚ	update_toÚlevelÚreasonNÚxr	   ÚyúTensor | NoneÚnameú
str | NoneÚreturnc                óL   — t          ¦   «         rt          j        | |¦  «        S dS )a?  
    This function performs SwiGLU activation to the input Tensor.

    .. math::

        out = silu(x) * y when y is not None
        out = silu(xs[0]) * xs[1] when y is None, where xs = paddle.chunk(x, 2, axis=-1)

    Args:
        x (Tensor): The first input Tensor of SwiGLU.
        y (Tensor, optional): The second input Tensor of SwiGLU. Default: None.
        name (str, optional): For details, please refer to :ref:`api_guide_Name`. Generally, no setting is required. Default: None.

    Returns:
        A Tensor with the same data type with x and y.

    Examples:
        .. code-block:: python

            >>> import paddle
            >>> import paddle.incubate.nn.functional as F
            >>> x = paddle.to_tensor([1, 2], dtype='float32')
            >>> out1, out2 = F.swiglu(x), F.swiglu(x, x)
            >>> print(out1, out2)
            Tensor(shape=[1], dtype=float32, place=Place(cpu), stop_gradient=True,
                   [1.46211720]) Tensor(shape=[2], dtype=float32, place=Place(cpu), stop_gradient=True,
                   [0.73105860, 3.52318811])
    N)r   r   Úswiglu)r   r   r   s      úd/var/www/html/banglarbhumi/venv/lib/python3.11/site-packages/paddle/incubate/nn/functional/swiglu.pyr   r      s/   € õJ ÑÔð #ÝŒ}˜Q Ñ"Ô"Ð"ð#ð #ó    )NN)r   r	   r   r   r   r   r   r	   )Ú
__future__r   Útypingr   Úpaddler   Úpaddle.utilsr   Ú	frameworkr   r	   r   © r   r   ú<module>r      sÐ   ðð #Ð "Ð "Ð "Ð "Ð "à  Ð  Ð  Ð  Ð  Ð  à Ð Ð Ð Ð Ð Ø #Ð #Ð #Ð #Ð #Ð #à 0Ð 0Ð 0Ð 0Ð 0Ð 0àð ØÐÐÐÐÐð €Ø
Ø+Ø
Ø|ð	ñ ô ð <@ð #ð  #ð  #ð  #ñô ð #ð  #ð  #r   