+
    þäûjà  ã                   ór   € ^ RI t ^ RIt^ RIt^ RIHt R R ltRR R lltRR R lltRR	 R
 lltR R lt	R# )é    N)Ú_calculate_fan_in_and_fan_outc          
      óh   € V ^8„  d   QhR\         P                  R\        R\        R\        R\        /# )é   ÚtensorÚmeanÚstdÚaÚb©ÚtorchÚTensorÚfloat)Úformats   "Ú\C:\Ai_Coding\apps\studio\ComfyUI\.venv\Lib\site-packages\spandrel\util\timm\__weight_init.pyÚ__annotate__r      s8   € ÷ %ñ %Ü�L‰Lð%Ü %ð%Ü,1ð%Ü6;ð%Ü@Eñ%ó    c                 óx  € R  R lpW^V,          ,
          8  g   W^V,          ,           8”  d   \         P                  ! R^R7       \        P                  ! 4       ;_uu_ 4        V! W1,
          V,          4      pV! WA,
          V,          4      pV P	                  ^V,          ^,
          ^V,          ^,
          4       V P                  4        V P                  V\        P                  ! R4      ,          4       V P                  V4       V P                  W4R7       V uuRRR4       #   + '       g   i     R# ; i)c                ó$   € V ^8„  d   QhR\         /# )r   Úx)r   )r   s   "r   r   Ú,_no_grad_trunc_normal_.<locals>.__annotate__   s   € ÷ :ñ :”Eñ :r   c                 ó€   € R \         P                  ! V \         P                  ! R4      ,          4      ,           R,          # )ç      ð?ç       @)ÚmathÚerfÚsqrt)r   s   &r   Únorm_cdfÚ(_no_grad_trunc_normal_.<locals>.norm_cdf   s(   € à”d—h’h˜q¤4§9¢9¨S£>Õ1Ó2Õ2°cÕ9Ð9r   zjmean is more than 2 std from [a, b] in nn.init.trunc_normal_. The distribution of values may be incorrect.)Ú
stacklevelr   )ÚminÚmaxN)ÚwarningsÚwarnr   Úno_gradÚuniform_Úerfinv_Úmul_r   r   Úadd_Úclamp_)r   r   r   r	   r
   r   ÚlÚus   &&&&&   r   Ú_no_grad_trunc_normal_r,      sÛ   € õ
:ð 	�1�s•7�{Ô ¨1¨s­7¥{Ô 2Ü�Šð;àõ	
ô 
�Š��ñ �a•h #Õ%Ó&ˆÙ�a•h #Õ%Ó&ˆð 	�‰˜˜A� �	 1 q¥5¨1¥9Ô-ð 	�‰Ôð 	�‰�Cœ$Ÿ)š) C›.Õ(Ô)Ø�‰�DÔð 	�‰˜!ˆÔ#Ø÷+ 
��‹ús   Á$B9D(Ä(D9	c                óˆ   € V ^8„  d   QhR\         P                  R\        R\        R\        R\        R\         P                  /# ©r   r   r   r   r	   r
   Úreturnr   )r   s   "r   r   r   0   sL   € ÷ ;ñ ;Ü�L‰Lð;ä
ð;ô 
ð;ô ð	;ô
 ð;ô ‡\�\ñ;r   c                ó   € \        WW#V4      # )ak  
Fills the input Tensor with values drawn from a truncated
normal distribution. The values are effectively drawn from the
normal distribution :math:`\mathcal{N}(\text{mean}, \text{std}^2)`
with values outside :math:`[a, b]` redrawn until they are within
the bounds. The method used for generating the random values works
best when :math:`a \leq \text{mean} \leq b`.

NOTE: this impl is similar to the PyTorch `trunc_normal_`, the bounds [a, b] are
applied while sampling the normal with mean/std applied, therefore a, b args
should be adjusted to match the range of mean, std args.

Args:
    tensor: an n-dimensional `torch.Tensor`
    mean: the mean of the normal distribution
    std: the standard deviation of the normal distribution
    a: the minimum cutoff value
    b: the maximum cutoff value
Examples:
    >>> w = torch.empty(3, 5)
    >>> nn.init.trunc_normal_(w)
)r,   ©r   r   r   r	   r
   s   &&&&&r   Útrunc_normal_r2   0   s   € ô: " &°¸Ó:Ð:r   c                óˆ   € V ^8„  d   QhR\         P                  R\        R\        R\        R\        R\         P                  /# r.   r   )r   s   "r   r   r   P   sL   € ÷ ñ Ü�L‰Lðä
ðô 
ðô ð	ô
 ðô ‡\�\ñr   c                óÖ   € \        V ^ RW44       \        P                  ! 4       ;_uu_ 4        V P                  V4      P	                  V4       RRR4       V #   + '       g   i     T # ; i)a}  Fills the input Tensor with values drawn from a truncated
normal distribution. The values are effectively drawn from the
normal distribution :math:`\mathcal{N}(\text{mean}, \text{std}^2)`
with values outside :math:`[a, b]` redrawn until they are within
the bounds. The method used for generating the random values works
best when :math:`a \leq \text{mean} \leq b`.

NOTE: this 'tf' variant behaves closer to Tensorflow / JAX impl where the
bounds [a, b] are applied when sampling the normal distribution with mean=0, std=1.0
and the result is subsquently scaled and shifted by the mean and std args.

Args:
    tensor: an n-dimensional `torch.Tensor`
    mean: the mean of the normal distribution
    std: the standard deviation of the normal distribution
    a: the minimum cutoff value
    b: the maximum cutoff value
Examples:
    >>> w = torch.empty(3, 5)
    >>> nn.init.trunc_normal_(w)
r   N)r,   r   r$   r'   r(   r1   s   &&&&&r   Útrunc_normal_tf_r5   P   sK   € ô8 ˜6 1 c¨1Ô0Ü	�Š��Ø�‰�CÓ×Ñ˜dÔ#÷ 
à€M÷ 
Žà€Mús   ¬!AÁA(	c                ó\   € V ^8„  d   QhR\         P                  R\        R\        R\        /# )r   r   ÚscaleÚmodeÚdistribution)r   r   r   Ústr)r   s   "r   r   r   r   s:   € ÷ Añ AÜ�L‰LðAäðAô ðAô ñ	Ar   c                 óÐ  € \        V 4      w  rEVR 8X  d   TpM VR8X  d   TpMVR8X  d   WE,           ^,          pVX,          pVR8X  d+   \        V \        P                  ! V4      R,          R7       R	# VR8X  d)   V P	                  \        P                  ! V4      R7       R	# VR8X  d3   \        P                  ! ^V,          4      pV P                  V) V4       R	# \        RV 24      h)
Úfan_inÚfan_outÚfan_avgÚtruncated_normalg�©Û¶ä%ì?)r   ÚnormalÚuniformzinvalid distribution N)r   r5   r   r   Únormal_r%   Ú
ValueError)	r   r7   r8   r9   r<   r=   ÚdenomÚvarianceÚbounds	   &&&&     r   Úvariance_scaling_rG   r   sÆ   € ô 4°FÓ;�O€FØˆxÔØ‰Ø	�Ô	Ø‰Ø	�Ô	ØÕ! QÕ&ˆà�u�}€HàÐ)Ô)ä˜¤T§Y¢Y¨xÓ%8Ð;NÕ%N×OØ	˜Ô	!Ø�‰œ4Ÿ9š9 XÓ.ˆÖ/Ø	˜Ô	"Ü—	’	˜!˜h�,Ó'ˆà�‰˜˜ Ö&äÐ0°°Ð?Ó@Ð@r   c                ó8   € V ^8„  d   QhR\         P                  /# )r   r   )r   r   )r   s   "r   r   r   �   s   € ÷ Nñ Nœ%Ÿ,™,ñ Nr   c                 ó"   € \        V R RR7       R# )r<   r?   )r8   r9   N)rG   )r   s   &r   Úlecun_normal_rJ   �   s   € Ü�f 8Ð:L×Mr   )g        r   g       Àr   )r   r<   r@   )
r   r"   r   Útorch.nn.initr   r,   r2   r5   rG   rJ   © r   r   Ú<module>rM      s/   ðÛ Û ã Ý 7õ%÷P;÷@÷DA÷:Nr   