+
    Jåûjð.  ã                   ó:  € ^ RI Ht ^ RIt. ROt ! R R]P                  P
                  4      t ! R R]P                  P                  4      t ! R R]P                  P                  4      t ! R R]P                  P                  4      t	 ! R R]P                  P                  4      t
 ! R R]P                  P                  4      t ! R R	]P                  P                  P                  P                  4      t ! R R
]P                  P                  4      tR# )é    )ÚwarnNÚReLU6Ú	HardswishÚELUÚ	LeakyReLUÚSigmoidÚSoftmaxÚMultiheadAttentionÚPReLUc                   óZ   a a€ ] tR t^t oRtRV 3R lltR tR t]RR l4       t	Rt
VtV ;t# )r   a¢  Applies the element-wise function:

:math:`\text{ReLU6}(x) = \min(\max(x_0, x), q(6))`, where :math:`x_0` is the
zero_point, and :math:`q(6)` is the quantized representation of number 6.

Args:
    inplace: can optionally do the operation in-place. Default: ``False``

Shape:
    - Input: :math:`(N, *)` where `*` means, any number of additional
      dimensions
    - Output: :math:`(N, *)`, same shape as the input

.. image:: ../scripts/activation_images/ReLU6.png

Examples::

    >>> m = nn.quantized.ReLU6()
    >>> input = torch.randn(2)
    >>> # xdoctest: +SKIP
    >>> input = torch.quantize_per_tensor(input, 1.0, 0, dtype=torch.qint32)
    >>> output = m(input)
c                ó2   <€ \         SV `  V4       Wn        R # ©N)ÚsuperÚ__init__Úinplace)Úselfr   Ú	__class__s   &&€ÚdC:\Ai_Coding\apps\studio\ComfyUI\.venv\Lib\site-packages\torch\ao\nn\quantized\modules\activation.pyr   ÚReLU6.__init__,   s   ø€ Ü‰Ñ˜Ô!ØŽó    c                óh   € \         P                  P                  P                  WP                  4      # r   )ÚtorchÚopsÚ	quantizedÚrelu6r   ©r   Úinputs   &&r   ÚforwardÚReLU6.forward0   s!   € Ü�y‰y×"Ñ"×(Ñ(¨·±Ó=Ð=r   c                ó   € R # )ÚQuantizedReLU6© ©r   s   &r   Ú	_get_nameÚReLU6._get_name3   ó   € Ùr   c                ó,   € \        V P                  4      # r   )r   r   )ÚmodÚuse_precomputed_fake_quants   &&r   Ú
from_floatÚReLU6.from_float6   s   € ä�S—[‘[Ó!Ð!r   )r   ©F)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r   r$   Ústaticmethodr*   Ú__static_attributes__Ú__classdictcell__Ú__classcell__©r   Ú__classdict__s   @@r   r   r      s2   ù‡ € ñ÷0ò>ò ð ó"ó ÷"ð "r   c                   ój   a a€ ] tR t^;t oRtRV 3R lltR tR t]R	R l4       t	]
R 4       tRtVtV ;t# )
r   z¶This is the quantized version of :class:`~torch.nn.Hardswish`.

Args:
    scale: quantization scale of the output tensor
    zero_point: quantization zero point of the output tensor
c                óÌ   <€ R VRV/p\         SV `  4        V P                  R\        P                  ! V3/ VB 4       V P                  R\        P                  ! V3/ VB 4       R# ©ÚdeviceÚdtypeÚscaleÚ
zero_pointN©r   r   Úregister_bufferr   Útensor)r   r=   r>   r;   r<   Úfactory_kwargsr   s   &&&&& €r   r   ÚHardswish.__init__C   sX   ø€ Ø" F¨G°UÐ;ˆÜ‰ÑÔØ×Ñ˜W¤e§l¢l°5Ñ&K¸NÑ&KÔLØ×Ñ˜\¬5¯<ª<¸
Ñ+UÀnÑ+UÖVr   c                ó~   € \         P                  P                  P                  WP                  V P
                  4      # r   )r   r   r   Ú	hardswishr=   r>   r   s   &&r   r   ÚHardswish.forwardI   s'   € Ü�y‰y×"Ñ"×,Ñ,¨U·J±JÀÇÁÓPÐPr   c                ó   € R # )ÚQuantizedHardswishr"   r#   s   &r   r$   ÚHardswish._get_nameL   ó   € Ù#r   c                óv   € V P                   P                  4       w  r#\        \        V4      \	        V4      4      # r   )Úactivation_post_processÚcalculate_qparamsr   ÚfloatÚint©r(   r)   r=   r>   s   &&  r   r*   ÚHardswish.from_floatO   s.   € à×7Ñ7×IÑIÓKÑˆÜœ˜u›¤s¨:£Ó7Ð7r   c                ó8   € V ! \        V4      \        V4      4      # r   ©rN   rO   ©Úclsr(   r=   r>   s   &&&&r   Úfrom_referenceÚHardswish.from_referenceT   s   € á”5˜“<¤ Z£Ó1Ð1r   r"   )NNr,   ©r-   r.   r/   r0   r1   r   r   r$   r2   r*   ÚclassmethodrV   r3   r4   r5   r6   s   @@r   r   r   ;   sH   ù‡ € ñ÷WòQò$ð ó8ó ð8ð ñ2ó ÷2ð 2r   c                   ój   a a€ ] tR t^Yt oRtRV 3R lltR tR t]R	R l4       t	]
R 4       tRtVtV ;t# )
r   zÑThis is the quantized equivalent of :class:`~torch.nn.ELU`.

Args:
    scale: quantization scale of the output tensor
    zero_point: quantization zero point of the output tensor
    alpha: the alpha constant
c                ó>   <€ \         SV `  V4       Wn        W n        R # r   )r   r   r=   r>   )r   r=   r>   Úalphar   s   &&&&€r   r   ÚELU.__init__b   s   ø€ Ü‰Ñ˜ÔØŒ
Ø$Žr   c                ó¼   € \         P                  P                  P                  P                  P                  WP                  V P                  V P                  4      # r   )	r   ÚaoÚnnr   Ú
functionalÚelur=   r>   r\   r   s   &&r   r   ÚELU.forwardg   s<   € Ü�x‰x�{‰{×$Ñ$×/Ñ/×3Ñ3Ø—:‘:˜tŸ™°·
±
ó
ð 	
r   c                ó   € R # )ÚQuantizedELUr"   r#   s   &r   r$   ÚELU._get_namel   s   € Ùr   c                óŒ   € V P                   P                  4       w  r#\        \        V4      \	        V4      V P
                  4      # r   )rL   rM   r   rN   rO   r\   rP   s   &&  r   r*   ÚELU.from_floato   s4   € à×7Ñ7×IÑIÓKÑˆÜ”5˜“<¤ Z£°#·)±)Ó<Ð<r   c                óN   € V ! \        V4      \        V4      VP                  4      # r   )rN   rO   r\   rT   s   &&&&r   rV   ÚELU.from_referencet   s   € á”5˜“<¤ Z£°#·)±)Ó<Ð<r   )r=   r>   )ç      ð?r,   rX   r6   s   @@r   r   r   Y   sF   ù‡ € ñ÷%ò

ò
ð ó=ó ð=ð ñ=ó ÷=ð =r   c                   óv   a a€ ] tR t^yt oRtR	V3R lV 3R llltR tR t]R
R l4       t	]R 4       t
RtVtV ;t# )r   a  This is the quantized equivalent of :class:`~torch.nn.LeakyReLU`.

Args:
    scale: quantization scale of the output tensor
    zero_point: quantization zero point of the output tensor
    negative_slope: Controls the angle of the negative slope. Default: 1e-2
c          
      ó6   <€ V ^8„  d   QhRS[ RS[RS[ RS[RR/# )é   r=   r>   Únegative_sloper   ÚreturnN)rN   rO   Úbool)Úformatr7   s   "€r   Ú__annotate__ÚLeakyReLU.__annotate__‚   sD   ø€ ÷ Wñ WáðWñ ðWñ ð	Wñ
 ðWð 
ñWr   c                óÎ   <€ R VRV/p\         SV `  W44       V P                  R\        P                  ! V3/ VB 4       V P                  R\        P                  ! V3/ VB 4       R# r:   r?   )	r   r=   r>   ro   r   r;   r<   rB   r   s	   &&&&&&& €r   r   ÚLeakyReLU.__init__‚   s\   ø€ ð # F¨G°UÐ;ˆÜ‰Ñ˜Ô1Ø×Ñ˜W¤e§l¢l°5Ñ&K¸NÑ&KÔLØ×Ñ˜\¬5¯<ª<¸
Ñ+UÀnÑ+UÖVr   c                óª   € \         P                  P                  P                  WP                  V P
                  V P                  V P                  4      # r   )r   r   r   Ú
leaky_reluro   r   r=   r>   r   s   &&r   r   ÚLeakyReLU.forward�   s:   € Ü�y‰y×"Ñ"×-Ñ-Ø×&Ñ&¨¯©°d·j±jÀ$Ç/Á/ó
ð 	
r   c                ó   € R # )ÚQuantizedLeakyReLUr"   r#   s   &r   r$   ÚLeakyReLU._get_name•   rJ   r   c                óœ   € VP                   P                  4       w  r4V ! \        V4      \        V4      VP                  VP
                  4      # r   )rL   rM   rN   rO   ro   r   )rU   r(   r)   r=   r>   s   &&&  r   r*   ÚLeakyReLU.from_float˜   s<   € à×7Ñ7×IÑIÓKÑˆÙ”5˜“<¤ Z£°#×2DÑ2DÀcÇkÁkÓRÐRr   c                ód   € V ! \        V4      \        V4      VP                  VP                  4      # r   )rN   rO   ro   r   rT   s   &&&&r   rV   ÚLeakyReLU.from_reference�   s%   € á”5˜“<¤ Z£°#×2DÑ2DÀcÇkÁkÓRÐRr   r"   )g{®Gáz„?FNNr,   )r-   r.   r/   r0   r1   r   r   r$   rY   r*   rV   r3   r4   r5   r6   s   @@r   r   r   y   sR   ù‡ € ñ÷Wõ Wò
ò
$ð óSó ðSð ñSó ÷Sð Sr   c                   ó\   a a€ ] tR t^¢t oRtV3R lV 3R lltR t]RR l4       tRt	Vt
V ;t# )r   z·This is the quantized equivalent of :class:`~torch.nn.Sigmoid`.

Args:
    scale: quantization scale of the output tensor
    zero_point: quantization zero point of the output tensor
c                ó&   <€ V ^8„  d   QhRS[ RS[/# )rn   Úoutput_scaleÚoutput_zero_pointrS   )rr   r7   s   "€r   rs   ÚSigmoid.__annotate__ª   s   ø€ ÷ 3ñ 3¡Uð 3¹sñ 3r   c                ó<   <€ \         SV `  4        Wn        W n        R # r   )r   r   rƒ   r„   )r   rƒ   r„   r   s   &&&€r   r   ÚSigmoid.__init__ª   s   ø€ Ü‰ÑÔØ(ÔØ!2Ör   c                ó~   € \         P                  P                  P                  WP                  V P
                  4      # r   )r   r   r   Úsigmoidrƒ   r„   r   s   &&r   r   ÚSigmoid.forward¯   s0   € Ü�y‰y×"Ñ"×*Ñ*Ø×$Ñ$ d×&<Ñ&<ó
ð 	
r   c                ór   € VP                   P                  4       w  ppV ! \        V4      \        V4      4      # r   )rL   rM   rN   rO   )rU   r(   r)   rƒ   r„   s   &&&  r   r*   ÚSigmoid.from_float´   s9   € ð
 ×'Ñ'×9Ñ9Ó;ñ	
ØØá”5˜Ó&¬Ð,=Ó(>Ó?Ð?r   )rƒ   r„   r,   )r-   r.   r/   r0   r1   r   r   rY   r*   r3   r4   r5   r6   s   @@r   r   r   ¢   s5   ù‡ € ñ÷3ó 3ò

ð
 ó@ó ÷@ð @r   c                   ój   a a€ ] tR t^½t oRtRV 3R lltR tR t]R	R l4       t	]
R 4       tRtVtV ;t# )
r	   a  This is the quantized version of :class:`~torch.nn.Softmax`.

Args:
    dim: A dimension along which Softmax will be computed (so every slice along dim will sum to 1).
    scale: quantization scale of the output tensor
    zero_point: quantization zero point of the output tensor
c                óH   <€ \         SV `  4        Wn        W n        W0n        R # r   )r   r   Údimr=   r>   )r   r�   r=   r>   r   s   &&&&€r   r   ÚSoftmax.__init__Æ   s   ø€ Ü‰ÑÔØŒØŒ
Ø$Žr   c                ó  € V P                   pVf<   ^p\        P                  P                  P	                  RVP                  4       V4      p\        P
                  P                  P                  WV P                  V P                  4      # )NÚsoftmax)
r�   r   r`   ra   Ú_get_softmax_dimr   r   r’   r=   r>   )r   r   r�   Ú
stacklevels   &&  r   r   ÚSoftmax.forwardÌ   sg   € Ø�h‰hˆØŠ;ØˆJô —(‘(×%Ñ%×6Ñ6Ø˜5Ÿ9™9›;¨
óˆCô �y‰y×"Ñ"×*Ñ*¨5°t·z±zÀ4Ç?Á?ÓSÐSr   c                ó   € R # )ÚQuantizedSoftmaxr"   r#   s   &r   r$   ÚSoftmax._get_name×   s   € Ù!r   c                óŒ   € V P                   P                  4       w  r#\        V P                  \	        V4      \        V4      4      # r   )rL   rM   r	   r�   rN   rO   rP   s   &&  r   r*   ÚSoftmax.from_floatÚ   s4   € à×7Ñ7×IÑIÓKÑˆÜ�s—w‘w¤ e£¬c°*«oÓ>Ð>r   c                óN   € V ! VP                   \        V4      \        V4      4      # r   )r�   rN   rO   rT   s   &&&&r   rV   ÚSoftmax.from_referenceß   s   € á�3—7‘7œE %›L¬#¨j«/Ó:Ð:r   )r�   r=   r>   )Nrk   r   r,   rX   r6   s   @@r   r	   r	   ½   sG   ù‡ € ñ÷%ò	Tò"ð ó?ó ð?ð ñ;ó ÷;ð ;r   c                   óš   a € ] tR t^ät o ]P
                  P                  P                  P                  t	R t
]R 4       t]R 4       tRtV tR# )r
   c                ó   € R # )ÚQuantizedMultiheadAttentionr"   r#   s   &r   r$   ÚMultiheadAttention._get_nameç   s   € Ù,r   c                ó   € \        R 4      h)zpIt looks like you are trying to convert a non-observed MHA module. Please, see the examples on quantizable MHAs.)ÚNotImplementedError)rU   Úothers   &&r   r*   ÚMultiheadAttention.from_floatê   s   € ô "ð0ó
ð 	
r   c                óN  € \         P                  P                  P                  VR RRR R7      pWn        VP
                  ei   VP                  P                  R4      p\         P                  ! VRR7      w  rE\         P                  ! W4V\         P                  4      p\        VRV4       VP                  ei   VP                  P                  R4      p\         P                  ! XRR7      w  rE\         P                  ! WdV\         P                  4      p\        VRV4       V=V=V# )NFT)Úmappingr   Úremove_qconfigÚconvert_custom_config_dictÚbias_k)Úreduce_rangeÚbias_v)r   r_   ÚquantizationÚconvertr   r©   Ú_parametersÚpopÚ_choose_qparams_per_tensorÚquantize_per_tensorÚquint8Úsetattrr«   Úin_proj_weightÚin_proj_bias)rU   r£   Ú	convertedr©   ÚscÚzpr«   s   &&     r   Úfrom_observedÚ MultiheadAttention.from_observedô   s  € ä—H‘H×)Ñ)×1Ñ1ØØØØØ'+ð 2ó 
ˆ	ð "Ôð ×ÑÒ'Ø×*Ñ*×.Ñ.¨xÓ8ˆFÜ×5Ò5°fÈ5ÔQ‰FˆBÜ×.Ò.¨v¸2¼u¿|¹|ÓLˆFÜ�I˜x¨Ô0à×ÑÒ'Ø×*Ñ*×.Ñ.¨xÓ8ˆFÜ×5Ò5ØØ"ô‰FˆBô ×.Ò.¨v¸2¼u¿|¹|ÓLˆFÜ�I˜x¨Ô0àÐ$ØÐ"àÐr   r"   N)r-   r.   r/   r0   r   r_   r`   Úquantizabler
   Ú_FLOAT_MODULEr$   rY   r*   r¹   r3   r4   )r7   s   @r   r
   r
   ä   sK   ø‡ € Ø—H‘H—K‘K×+Ñ+×>Ñ>€Mò-ð ñ
ó ð
ð ñ ó ö r   c                   ó”   a a€ ] tR tRt oRtRV3R lV 3R llltV3R lR ltV3R lR ltR	 t]	RR
 l4       t
]	R 4       tRtVtV ;t# )r   i  a  This is the quantized equivalent of :class:`~torch.nn.PReLU`.

Args:
    scale: quantization scale of the output tensor
    zero_point: quantization zero point of the output tensor
    num_parameters: number of parameters: 1, or the number of channels at input. Default: 1
c                ó0   <€ V ^8„  d   QhRS[ RS[RS[RR/# )rn   rƒ   r„   Únum_parametersrp   NrS   )rr   r7   s   "€r   rs   ÚPReLU.__annotate__!  s-   ø€ ÷ 	ñ 	Ù!ð	Ù69ð	ÙKNð	à	ñ	r   c                ó  <€ \         SV `  4        W0n        Wn        W n        \
        P                  ! V\
        P                  R 7      p\
        P                  ! VR^ \
        P                  R7      pV P                  V4       R# ))r<   rk   )r=   r>   r<   N)r   r   r¿   r=   r>   r   ÚrandnrN   r±   r²   Ú
set_weight)r   rƒ   r„   r¿   ÚwÚqwr   s   &&&&  €r   r   ÚPReLU.__init__!  sZ   ø€ ô 	‰ÑÔØ,ÔØ!Œ
Ø+ŒÜ�KŠK˜¬e¯k©kÔ:ˆÜ×&Ò& q°ÀÌÏÉÔVˆØ�‰˜Ör   c                ó8   <€ V ^8„  d   QhRS[ P                  RR/# )rn   rÄ   rp   N©r   ÚTensor)rr   r7   s   "€r   rs   rÀ   ,  s   ø€ ÷ ñ ™EŸL™Lð ¨Tñ r   c                ó   € Wn         R # r   )Úweight)r   rÄ   s   &&r   rÃ   ÚPReLU.set_weight,  s   € ØŽr   c                óN   <€ V ^8„  d   QhRS[ P                  RS[ P                  /# )rn   r   rp   rÈ   )rr   r7   s   "€r   rs   rÀ   /  s#   ø€ ÷ 
ñ 
™UŸ\™\ð 
©e¯l©lñ 
r   c                ó”   € \         P                  P                  P                  WP                  V P
                  V P                  4      # r   )r   r   r   ÚprelurË   r=   r>   r   s   &&r   r   ÚPReLU.forward/  s2   € Ü�y‰y×"Ñ"×(Ñ(Ø—;‘; §
¡
¨D¯O©Oó
ð 	
r   c                ó   € R # )ÚQuantizedPReLUr"   r#   s   &r   r$   ÚPReLU._get_name4  r&   r   c                ó,  € VP                   P                  4       w  r4V ! \        V4      \        V4      VP                  4      pVP
                  P                  4       pVP                  P                  4       pV! V4       VP                  \        P                  8w  d   \        R VP                   2^R7       VP                  4       w  r‰\        P                  ! V\        V4      \        V	4      \        P                  4      p
VP                  V
4       V# ©z9PReLU's weight observer should have dtype quint8 but got )r”   )rL   rM   rN   rO   r¿   rË   Úqconfigr<   r   r²   r   r±   rÃ   )rU   r(   r)   r=   r>   ÚqpreluÚfloat_wtÚobserverÚwt_scaleÚwt_zpÚqweights   &&&        r   r*   ÚPReLU.from_float7  s×   € à×7Ñ7×IÑIÓKÑˆÙ”U˜5“\¤3 z£?°C×4FÑ4FÓGˆØ—:‘:×#Ñ#Ó%ˆØ—;‘;×%Ñ%Ó'ˆÙ�ÔØ�>‰>œUŸ\™\Ô)ÜØKÈHÏNÉNÐK[Ð\Øõð #×4Ñ4Ó6‰ˆÜ×+Ò+Ø”e˜H“o¤s¨5£z´5·<±<ó
ˆð 	×Ñ˜'Ô"Øˆr   c                óô  € V ! \        V4      \        V4      VP                  4      pVP                  P                  4       pVP                  P                  4       pV! V4       VP
                  \        P                  8w  d   \        R VP
                   2^R7       VP                  4       w  rx\        P                  ! V\        V4      \        V4      \        P                  4      p	VP                  V	4       V# rÕ   )rN   rO   r¿   rË   rÖ   r<   r   r²   r   rM   r±   rÃ   )
rU   r(   r=   r>   r×   rØ   rÙ   rÚ   rÛ   rÜ   s
   &&&&      r   rV   ÚPReLU.from_referenceJ  sÀ   € á”U˜5“\¤3 z£?°C×4FÑ4FÓGˆØ—:‘:×#Ñ#Ó%ˆØ—;‘;×%Ñ%Ó'ˆÙ�ÔØ�>‰>œUŸ\™\Ô)ÜØKÈHÏNÉNÐK[Ð\Øõð #×4Ñ4Ó6‰ˆÜ×+Ò+Ø”e˜H“o¤s¨5£z´5·<±<ó
ˆð 	×Ñ˜'Ô"Øˆr   )r¿   r=   rË   r>   )é   r,   )r-   r.   r/   r0   r1   r   rÃ   r   r$   rY   r*   rV   r3   r4   r5   r6   s   @@r   r   r     sZ   ù‡ € ñ÷	õ 	÷ð ÷
ð 
ò
 ð óó ðð$ ñó ÷ð r   )r   r   r   r   r   r	   r
   r   )Úwarningsr   r   Ú__all__r`   ÚReLUr   r   r   r   r   r	   r_   r»   r
   ÚModuler   r"   r   r   Ú<module>rå      sÑ   ðå ã ò	€ô%"ˆE�H‰H�M‰Mô %"ôP2�—‘×"Ñ"ô 2ô<=ˆ%�(‰(�,‰,ô =ô@&S�—‘×"Ñ"ô &SôR@ˆe�h‰h×Ñô @ô6$;ˆe�h‰h×Ñô $;ôN1˜Ÿ™Ÿ™×0Ñ0×CÑCô 1ôhBˆE�H‰H�O‰Oö Br   