o
     ¢iG  ã                   @   s<   d dl Z d dlZd dlmZ d dlmZ G dd„ deƒZdS )é    N)ÚTensor)ÚModulec                   @   s"   e Zd ZdZdedefdd„ZdS )ÚGeluNewzAGELU approximation, called `gelu_new` in many transformer models.ÚinputÚreturnc                 C   s6   d| dt  t dtj ¡|dt  |d¡   ¡  S )zE
        Shapes:
            input - (batch, seq_len, width)
        g      à?g      ð?g       @g÷Hmâä¦?g      @)ÚtorchÚtanhÚmathÚsqrtÚpiÚpow)Úselfr   © r   ú[/home/ubuntu/.local/lib/python3.10/site-packages/curated_transformers/models/activations.pyÚforward
   s   ÿÿÿÿýÿzGeluNew.forwardN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   r      s    r   )r	   r   r   Útorch.nnr   r   r   r   r   r   Ú<module>   s
    