
    Ng                     V    d Z ddlZddlmc mZ ddlmZ  G d dej                  ZdS )z% Linear layer (alternate definition)
    N)nnc                   6    e Zd ZdZdej        dej        fdZdS )LinearzApplies 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                 :   t           j                                        r^| j         | j                            |j                  nd }t          j        || j                            |j                  |          S t          j        || j        | j                  S )N)dtype)bias)	torchjitis_scriptingr
   tor	   Flinearweight)selfr   r
   s      N/var/www/html/ai-engine/env/lib/python3.11/site-packages/timm/layers/linear.pyforwardzLinear.forward   s}    9!!## 	;6:i6K49<<ek<222QUD8E4;>>>#D#D4PPPP8E4;	:::    N)__name__
__module____qualname____doc__r   Tensorr    r   r   r   r      sD         
;U\ ;el ; ; ; ; ; ;r   r   )r   r   torch.nn.functionalr   
functionalr   r   r   r   r   <module>r      s{                    ; ; ; ; ;RY ; ; ; ; ;r   