U
    ¯Ê¹jç  ã                   @   s@   d Z ddlZddlm  mZ ddlmZ G dd„ dejƒZdS )z% Linear layer (alternate definition)
é    N)Únnc                   @   s$   e Zd ZdZejejdœdd„ZdS )ÚLinearzûApplies a linear transformation to the incoming data: :math:`y = xA^T + b`

    Wraps torch.nn.Linear to support AMP + torchscript usage by manually casting
    weight & bias to input.dtype to work around an issue w/ torch.addmm in this use case.
    )ÚinputÚreturnc                 C   sZ   t j ¡ rD| jd k	r$| jj|jd�nd }tj|| jj|jd�|d�S t || j| j¡S d S )N)Údtype)Úbias)	ÚtorchZjitZis_scriptingr   Útor   ÚFZlinearÚweight)Úselfr   r   © r   úQ/var/www/html/bwave/python/venv/lib/python3.8/site-packages/timm/layers/linear.pyÚforward   s    
zLinear.forwardN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   ZTensorr   r   r   r   r   r      s   r   )r   r   Ztorch.nn.functionalr   Z
functionalr
   r   r   r   r   r   Ú<module>   s   