o
    W+ i                     @   s*   d dl Z d dlmZ G dd dejZdS )    Nc                       s&   e Zd Zd fdd	Zdd Z  ZS )AFF@      c                    sj   t t|   t|| }ttj|d |ddddt|tjddtj||ddddt|| _	d S )N      r   )Zkernel_sizeZstridepaddingT)Zinplace)
superr   __init__intnnZ
SequentialZConv2dZBatchNorm2dZSiLU	local_att)selfZchannelsrZinter_channels	__class__ m/home/app/PaddleOCR-VL-test/.venv_paddleocr/lib/python3.10/site-packages/modelscope/models/audio/sv/fusion.pyr	      s"   


zAFF.__init__c                 C   sJ   t j||fdd}| |}dt | }t ||t |d|  }|S )Nr   )dimg      ?g       @)torchcatr   tanhmul)r   xZds_yZxaZx_attZxor   r   r   forward   s
   
zAFF.forward)r   r   )__name__
__module____qualname__r	   r   __classcell__r   r   r   r   r      s    r   )r   Ztorch.nnr   Moduler   r   r   r   r   <module>   s   