+
    –°³jÃ*  ã                   óæ  a € R t-0 t ^ RIt^ RIHt ^ RIHt ^ RIHu Hu H	t
 ^ RIHt ^ RIHtHtHt . ROtR tR tR tR tR	 t/ ]P,                  ]P.                  3]b]P,                  ]P.                  ]P0                  3]b]P2                  ]P4                  3]b]P2                  ]P4                  ]P0                  3]b]P6                  ]P8                  3]b]P6                  ]P8                  ]P0                  3]b]P,                  ]P0                  3]! ]
P:                  4      b]P2                  ]P0                  3]! ]
P<                  4      b]P6                  ]P0                  3]! ]
P>                  4      b]P@                  ]P.                  3]b]P@                  ]P0                  3]! ]
PB                  4      b]P4                  ]P0                  3]! ]
PD                  4      b]P8                  ]P0                  3]! ]
PF                  4      b]PH                  ]P.                  3]b]PJ                  ]P4                  3]b]PL                  ]P8                  3]bt'] ^ k RR
 lt(R t)R t*R t+R R lt,R# )é    N)ÚCallable)ÚAny)Úget_combined_dictÚMatchAllNodeÚPatternc                ó~  € VP                   VP                   8w  d   \        R4      h\        P                  \        P
                  \        P                  \        P                  \        P                  \        P                  /pV '       d–   VP                  VP                  8w  d   \        R4      hVP                  '       g   \        R4      hVP                  '       g   \        R4      hVP                  \        V4      4      pVe	   V! W4      # \!        RW3 24      h\        P"                  P%                  W4      # )aè  Return the fused conv and bn modules.
Given the conv and bn modules, fuses them and returns the fused module

Args:
    is_qat: a flag for whether we are using quantization aware training fusion
    or post training quantization fusion
    conv: Module instance of type conv2d/conv3d
    bn: Spatial BN instance that needs to be fused with the conv

Examples::

    >>> m1 = nn.Conv2d(10, 20, 3)
    >>> b1 = nn.BatchNorm2d(20)
    >>> # xdoctest: +SKIP
    >>> m2 = fuse_conv_bn(m1, b1)
ú:Conv and BN both must be in the same mode (train or eval).z@Output channel of Conv2d must match num_features of BatchNorm2d.ú7Only support fusing BatchNorm2d with affine set to TrueúGOnly support fusing BatchNorm2d with tracking_running_stats set to TrueúCannot fuse train modules: )ÚtrainingÚAssertionErrorÚnnÚConv1dÚnniÚConvBn1dÚConv2dÚConvBn2dÚConv3dÚConvBn3dÚnum_featuresÚout_channelsÚaffineÚtrack_running_statsÚgetÚtypeÚNotImplementedErrorÚutilsÚfuse_conv_bn_eval)Úis_qatÚconvÚbnÚfused_module_class_mapÚfused_module_classs   &&&  Úl/home/luca/screen-checking/.venv/lib/python3.14/site-packages/torch/ao/quantization/fuser_method_mappings.pyÚfuse_conv_bnr&      s  € ð" ‡}�}˜Ÿ™Ô#ÜØHó
ð 	
ô
 	�	‰	”3—<‘<Ü
�	‰	”3—<‘<Ü
�	‰	”3—<‘<ðÐ÷ Ø�?‰?˜d×/Ñ/Ô/Ü ØRóð ð �y�yˆyÜ ØIóð ð ×%×%Ð%Ü ØYóð ð 4×7Ñ7¼¸T»
ÓCÐØÒ)Ù% dÓ/Ð/ä%Ð(CÀTÀJÀ<Ð&PÓQÐQä�x‰x×)Ñ)¨$Ó3Ð3ó    c                óæ  € VP                   VP                   u;8X  d   VP                   8X  g   M \        R4      hRpV '       dô   \        P                  \        P
                  \        P                  \        P                  \        P                  \        P                  /pVP                  VP                  8w  d   \        R4      hVP                  '       g   \        R4      hVP                  '       g   \        R4      hVP                  \        V4      4      pVe
   V! WV4      # \!        RWV3 24      h\        P                  \        P"                  \        P                  \        P$                  \        P                  \        P&                  /pVP                  \        V4      4      pVe2   \        P(                  P*                  P-                  W4      pV! Ws4      # \!        RWV3 24      h)a  Return the fused conv and bn modules.

Given the conv and bn modules, fuses them and returns the fused module

Args:
    is_qat: a flag for whether we are using quantization aware training fusion
    or post training quantization fusion
    conv: Module instance of type conv2d/conv3d
    bn: Spatial BN instance that needs to be fused with the conv

Examples::

    >>> m1 = nn.Conv2d(10, 20, 3)
    >>> b1 = nn.BatchNorm2d(20)
    >>> r1 = nn.ReLU(inplace=False)
    >>> # xdoctest: +SKIP
    >>> m2 = fuse_conv_bn_relu(m1, b1, r1)
r	   Nz?Output channel of Conv2d must match num_features of BatchNorm2dr
   r   r   zCannot fuse eval modules: )r   r   r   r   r   ÚConvBnReLU1dr   ÚConvBnReLU2dr   ÚConvBnReLU3dr   r   r   r   r   r   r   Ú
ConvReLU1dÚ
ConvReLU2dÚ
ConvReLU3dr   Úfusionr   )r    r!   r"   ÚreluÚfused_moduleÚmap_to_fused_module_trainÚmap_to_fused_module_evalÚ
fused_convs   &&&&    r%   Úfuse_conv_bn_relur5   G   s”  € ð& �M‰M˜RŸ[™[Ö9¨D¯M©MÖ9ÜØHó
ð 	
ð 04€Lßä�I‰I”s×'Ñ'Ü�I‰I”s×'Ñ'Ü�I‰I”s×'Ñ'ð%
Ð!ð
 �?‰?˜d×/Ñ/Ô/Ü ØQóð ð �y�yˆyÜ ØIóð ð ×%×%Ð%Ü ØYóð ð 1×4Ñ4´T¸$³ZÓ@ˆØÒ#Ù ¨$Ó/Ð/ä%Ð(CÀTÈtÐDTÐCUÐ&VÓWÐWô �I‰I”s—~‘~Ü�I‰I”s—~‘~Ü�I‰I”s—~‘~ð$
Ð ð
 0×3Ñ3´D¸³JÓ?ˆØÒ#ÜŸ™Ÿ™×:Ñ:¸4ÓDˆJÙ 
Ó1Ð1ä%Ð(BÀDÈdÐCSÐBTÐ&UÓVÐVr'   c                óœ  € VP                   VP                   8w  d   \        R4      hV '       dw   VP                  VP                  8w  d   \        R4      hVP                  '       g   \        R4      hVP
                  '       g   \        R4      h\        P                  ! W4      # \        P                  P                  P                  W4      # )aï  Return the fused linear and bn modules.
Given the linear and bn modules, fuses them and returns the fused module

Args:
    is_qat: a flag for whether we are using quantization aware training fusion
    or post training quantization fusion
    linear: Module instance of type Linear
    bn: BatchNorm1d instance that needs to be fused with the linear layer

Examples::

    >>> m1 = nn.Linear(20, 10)
    >>> b1 = nn.BatchNorm1d(10)
    >>> # xdoctest: +SKIP
    >>> m2 = fuse_linear_bn(m1, b1)
z<Linear and BN both must be in the same mode (train or eval).z@Output features of Linear must match num_features of BatchNorm1dz7Only support fusing BatchNorm1d with affine set to TruezGOnly support fusing BatchNorm1d with tracking_running_stats set to True)r   r   r   Úout_featuresr   r   r   Ú
LinearBn1dr   r   r/   Úfuse_linear_bn_eval)r    Úlinearr"   s   &&&r%   Úfuse_linear_bnr;   „   s®   € ð" ‡�˜"Ÿ+™+Ô%ÜØJó
ð 	
÷ Ø�?‰?˜f×1Ñ1Ô1Ü ØRóð ð �y�yˆyÜ ØIóð ð ×%×%Ð%Ü ØYóð ô �~Š~˜fÓ)Ð)ä�x‰x�‰×2Ñ2°6Ó>Ð>r'   c                óÊ   € VP                   VP                   8w  d   \        R4      hV '       d   \        R4      h\        P                  P
                  P                  WRR7      # )aÓ  Return the fused ConvTranspose and bn modules.
Given ConvTranspose and bn modules, fuses them and returns the fused module

Args:
    convt: Module instance of type ConvTransposeNd
    bn: BatchNormNd instance that needs to be fused with the linear layer.
        batch norm N should match the ConvTranspose N

Examples::

    >>> m1 = nn.ConvTranspose2d(10, 20, 3)
    >>> b1 = nn.BatchNorm2d(20)
    >>> # xdoctest: +SKIP
    >>> m2 = fuse_convtranspose_bn(m1, b1)
zCConvTranspose and BN both must be in the same mode (train or eval).z8Fusing ConvTranspose+BatchNorm not yet supported in QAT.T)Ú	transpose)r   r   Ú	Exceptionr   r   r/   r   )r    Úconvtr"   s   &&&r%   Úfuse_convtranspose_bnr@   ¬   sY   € ð  ‡~�~˜Ÿ™Ô$ÜØQó
ð 	
÷ ÜØFó
ð 	
ô �x‰x�‰×0Ñ0°ÀdÐ0ÓKÐKr'   c                ó   a € V 3R lpV# )a  Return a sequential wrapped that for is_qat and two modules.
Given a sequential class for two modules, return a function that takes
is_qat, and then two modules as argument, that ignores the is_qat flag
and always returns the sequential that combines the two input modules
c                 ó   <€ S! W4      # ©N© )r    Úm1Úm2Ú
sequentials   &&&€r%   Úfuser_methodÚ*_sequential_wrapper2.<locals>.fuser_methodÐ   s   ø€ Ù˜"Ó!Ð!r'   rD   )rG   rH   s   f r%   Ú_sequential_wrapper2rJ   É   s   ø€ õ"ð Ðr'   c                ó|   € Vf   / p\        \        V4      pVP                  V R4      pVf   \        RV  R24      hV# )z–Get fuser method for the given list of module types.

Get fuser method for the given list of module types,
return None if fuser method does not exist
Núdid not find fuser method for: Ú )r   Ú _DEFAULT_OP_LIST_TO_FUSER_METHODr   r   )Úop_listÚadditional_fuser_method_mappingÚall_mappingsrH   s   &&  r%   Úget_fuser_methodrR   ê   sU   € ð 'Ò.Ø*,Ð'Ü$Ü(Ð*Ió€Lð  ×#Ñ# G¨TÓ2€LØÒÜÐ>¸w¸iÀqÐIÓJÐJØÐr'   c                 ó   a € V 3R  lpV# )c                 ó   <€ S! WV4      # rC   rD   )r    ÚxÚyÚfs   &&&€r%   ÚreversedÚ_reverse2.<locals>.reversedü   s   ø€ Ù�˜A‹Ðr'   rD   ©rW   rX   s   f r%   Ú	_reverse2r[   û   s   ø€ õð €Or'   c                 ó   a € V 3R  lpV# )c                 ó   <€ Vw  r4S! WW14      # rC   rD   )r    rU   ÚwrV   ÚzrW   s   &&&  €r%   rX   Ú_reverse3.<locals>.reversed  s   ø€ Ø‰ˆÙ�˜AÓ!Ð!r'   rD   rZ   s   f r%   Ú	_reverse3ra     s   ø€ õ"ð €Or'   c                óÊ   € \        V \        \        34      '       d:   V  Uu. uF  p\        V4      NK  	  pp\        \        P
                  ! V!  4      pV# V \        .pV# u upi )a  Return a list of valid patterns generated from the op_pattern.

Returns a list of valid patterns generated from the op_pattern,
since MatchAllNode can match all types of nodes,
e.g. pattern (torch.nn.Conv2d, torch.add) should also be able to match keys like
(MatchAllNode, torch.add) and (torch.nn.Conv2d, MatchAllNode)

Example Input:
(torch.add, (torch.nn.ReLU, torch.nn.Conv2d))

Example Output:
[(torch.add, (torch.nn.ReLU, torch.nn.Conv2d)),
 (torch.add, (torch.nn.ReLU, MatchAllNode)),
 (torch.add, (MatchAllNode, torch.nn.Conv2d)),
 (torch.add, (MatchAllNode, MatchAllNode)),
 (MatchAllNode, (torch.nn.ReLU, torch.nn.Conv2d)),
 (MatchAllNode, (torch.nn.ReLU, MatchAllNode)),
 (MatchAllNode, (MatchAllNode, torch.nn.Conv2d)),
 (MatchAllNode, (MatchAllNode, MatchAllNode)),
]
)Ú
isinstanceÚtupleÚlistÚ_get_valid_patternsÚ	itertoolsÚproductr   )Ú
op_patternÚsub_patternÚ	sub_combsÚresults   &   r%   rf   rf   
  sb   € ô. �*œu¤d˜m×,Ò,ÙISÓTÉ¸+Ô(¨Ö5Éˆ	ÐTÜ”i×'Ò'¨Ñ3Ó4ˆð €Mð œlÐ+ˆØ€Mùò	 Us   ¡A c                ó|   € V ^8„  d   QhR\         R\        \         \        P                  \        ,          3,          /# )é   ri   Úfuser_method_mapping)r   Údictr   Ú
Sequentialr   )Úformats   "r%   Ú__annotate__rs   )  s/   € ÷ ñ Üðäœw¬¯©¼Õ(@Ð@ÕAñr'   c                ó†   € \        V 4      pRpV F  p VP                  V 4      pVf   K   M	  Vf   \        RV  R24      hV# )zŸGet fuser method.

This will be made default after we deprecate the get_fuser_method
Would like to implement this first and have a separate PR for deprecation
NrL   rM   )rf   r   r   )ri   ro   Úop_patternsrH   s   &&  r%   Úget_fuser_method_newrv   )  sY   € ô & jÓ1€KØ€LÛ!ˆ
Ø+×/Ñ/°
Ó;ˆØÔ#Ùñ "ð ÒÜÐ>¸z¸lÈ!ÐLÓMÐMØÐr'   c                óŒ   € V ^8„  d   Qh/ ^ \         9   d0   \        \        \        P                  \
        ,          3,          ;R&   # )rn   rN   )Ú__conditional_annotations__rp   rd   r   rq   r   )rr   s   "r%   rs   rs      s3   € × Ñ ÷hò ¤$¤u¬b¯m©m¼hÕ.FÐ'FÕ"Gñ òi r'   )r&   r5   r;   r@   rR   rv   rC   ).rx   rg   Úcollections.abcr   Útypingr   Útorch.ao.nn.intrinsicÚaor   Ú	intrinsicr   Útorch.nnÚtorch.ao.quantization.utilsr   r   r   Ú__all__r&   r5   r;   r@   rJ   r   ÚBatchNorm1dÚReLUr   ÚBatchNorm2dr   ÚBatchNorm3dr,   r-   r.   ÚLinearÚ
LinearReLUÚBNReLU2dÚBNReLU3dÚConvTranspose1dÚConvTranspose2dÚConvTranspose3drN   rR   r[   ra   rf   rv   rs   )rx   s   @r%   Ú<module>rŒ      sc  øðç Ð Ý $Ý ç #Ó #Ý ß PÑ Pò€ò/4òd:Wòz%?òPLò:
ðKØ‡Y�Y�—‘Ð ðKà‡Y�Y�—‘ §¡Ð(Ð*;ðKð ‡Y�Y�—‘Ð ðKð ‡Y�Y�—‘ §¡Ð(Ð*;ð	Kð
 ‡Y�Y�—‘Ð ðKð ‡Y�Y�—‘ §¡Ð(Ð*;ðKð ‡Y�Y�—‘ÐÑ.¨s¯~©~Ó>ðKð ‡Y�Y�—‘ÐÑ.¨s¯~©~Ó>ðKð ‡Y�Y�—‘ÐÑ.¨s¯~©~Ó>ðKð ‡Y�Y�—‘Ð ðKð ‡Y�Y�—‘ÐÑ.¨s¯~©~Ó>ðKð ‡^�^�R—W‘WÐÑ3°C·L±LÓAðKð ‡^�^�R—W‘WÐÑ3°C·L±LÓAðKð ×Ñ˜Ÿ™Ð(Ð*?ðKð ×Ñ˜Ÿ™Ð(Ð*?ðKð  ×Ñ˜Ÿ™Ð(Ð*?ð!KÐ  ó ô(ò"òò÷>r'   