o
    ®åÀi4  ã                   @   sB   d dl mZ d dlZd dlmZ d dlmZ G dd„ dejƒZdS )é    )ÚUnionN)ÚTensor)Únnc                	       sN   e Zd Z		ddedeeef deddf‡ fdd	„Zd
edefdd„Z	‡  Z
S )Ú
LayerScaleçñhãˆµøä>FÚdimÚinit_valuesÚinplaceÚreturnNc                    s*   t ƒ  ¡  || _t |t |¡ ¡| _d S ©N)ÚsuperÚ__init__r	   r   Ú	ParameterÚtorchÚonesÚgamma)Úselfr   r   r	   ©Ú	__class__© ú?/data/cameron/moge_repo/moge/model/dinov2/layers/layer_scale.pyr      s   
zLayerScale.__init__Úxc                 C   s   | j r	| | j¡S || j S r   )r	   Úmul_r   )r   r   r   r   r   Úforward   s   zLayerScale.forward)r   F)Ú__name__Ú
__module__Ú__qualname__Úintr   Úfloatr   Úboolr   r   Ú__classcell__r   r   r   r   r      s    üþ
ýüû
r   )Útypingr   r   r   r   ÚModuler   r   r   r   r   Ú<module>   s
   