+
    ˜°³j  ã                   ót   € R t ^ RIt^ RIHt ^ RIHt ^ RIHt  ! R R]4      t	RR R llt
R	 R
 ltR R ltR# )zKThis module contains utility method for mobile model optimization and lint.N)ÚEnum)Ú_MobileOptimizerType)ÚAnyStrc                   ó&   € ] tR t^	t^t^t^t^tRtR# )ÚLintCode© N)	Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__ÚBUNDLED_INPUTÚREQUIRES_GRADÚDROPOUTÚ	BATCHNORMÚ__static_attributes__r   ó    Ú]/home/luca/screen-checking/.venv/lib/python3.14/site-packages/torch/utils/mobile_optimizer.pyr   r   	   s   † Ø€MØ€MØ€GØ„Ir   r   c          
      óì   € V ^8„  d   QhR\         P                  P                  R\        \        ,          R,          R\
        \        ,          R,          R\        R\         P                  P                  /# )é   Úscript_moduleÚoptimization_blocklistNÚpreserved_methodsÚbackendÚreturn)	ÚtorchÚjitÚScriptModuleÚsetÚMobileOptimizerTypeÚlistr   ÚstrÚRecursiveScriptModule)Úformats   "r   Ú__annotate__r#      si   € ÷ :Fñ :FÜ—y‘y×-Ñ-ð:Fä #Ô$7Õ 8¸4Õ ?ð:Fô  ¤�<¨$Õ.ð:Fô ð	:Fô "'§¡×!@Ñ!@ñ	:Fr   c                ó  a € \        S \        P                  P                  4      '       g   \	        R\        S 4       R24      hVf   \        4       pVf   . pV Uu. uF  p\        V4      NK  	  pp\        S V4      p\        ;QJ d    V 3R lV 4       F  '       d   K   RM	  RM! V 3R lV 4       4      '       d   \        \        WV,           4      4      pV Uu. uF  p\        S V4      '       d   K  VNK  	  ppV'       d   \        RRP                  V4       24      hVP                  4       pVR8X  d-   \        P                  P!                  S P"                  VV4      pMpVR	8X  d-   \        P                  P%                  S P"                  VV4      pM=VR
8X  d,   \        P                  P'                  S P"                  V4      pM\	        R4      h\        P                  P(                  P+                  V4      # u upi u upi )aœ  
Optimize a torch script module for mobile deployment.

Args:
    script_module: An instance of torch script module with type of ScriptModule.
    optimization_blocklist: A set with type of MobileOptimizerType. When set is not passed,
        optimization method will run all the optimizer pass; otherwise, optimizer
        method will run the optimization pass that is not included inside optimization_blocklist.
    preserved_methods: A list of methods that needed to be preserved when freeze_module pass is invoked
    backend: Device type to use for running the result model ('CPU'(default), 'Vulkan' or 'Metal').
Returns:
    A new optimized torch script module
úGot ú, but ScriptModule is expected.c              3   ó<   <"  € T F  p\        SV4      x € K  	  R # 5i)N)Úhasattr)Ú.0Úmethodr   s   & €r   Ú	<genexpr>Ú&optimize_for_mobile.<locals>.<genexpr>1   s   øé € Ð
RÑ8Q¨fŒ7�= &×)Ð)Ó8Qùs   ƒFTzAThe following methods to preserve do not exist in script_module: z, ÚcpuÚvulkanÚmetalz:Unknown backend, must be one of 'CPU', 'Vulkan' or 'Metal')Ú
isinstancer   r   r   Ú	TypeErrorÚtyper   r    Ú(_get_bundled_inputs_preserved_attributesÚallr   r(   ÚAttributeErrorÚjoinÚlowerÚ_CÚ_jit_pass_optimize_for_mobileÚ_cÚ$_jit_pass_vulkan_optimize_for_mobileÚ#_jit_pass_metal_optimize_for_mobileÚ
_recursiveÚwrap_cpp_module)	r   r   r   r   r*   Úpreserved_methods_strÚbundled_inputs_attributesÚnon_exist_methodsÚoptimized_cpp_modules	   f&&&     r   Úoptimize_for_mobilerC      sÏ  ø€ ô$ �m¤U§Y¡Y×%;Ñ%;×<Ò<ÜØ”4˜Ó&Ð'Ð'FÐGóIð 	Ið Ò%Ü!$£ÐàÒ ØÐñ
 CTÓ'TÑBS¸¬¨F®ÑBSÐÐ'Tä HÈÐXmÓ nÐß
ƒsÔ
RÑ8QÓ
R‡s‡s‚sÔ
RÑ8QÓ
R×RÒRÜ $¤SÐ)>Õ)ZÓ%[Ó \Ðá.CÓjÑ.C FÌ7ÐS`Ðbh×KiŸ˜Ñ.CÐÐjßÜØOÐPT×PYÑPYÐZkÓPlÐOmÐnópð 	pð �m‰m‹o€GØ�%ÔÜ$Ÿx™x×EÑEØ×ÑØ"Ø!ó #Ñð 
�HÔ	Ü$Ÿx™x×LÑLØ×ÑØ"Ø!ó #Ñð 
�GÔ	Ü$Ÿx™x×KÑKÈM×L\ÑL\Ð^sÓtÑäÐTÓUÐUä�9‰9×Ñ×/Ñ/Ð0DÓEÐEùò7 (Uùò ks   ÁG>ÃHÃ5Hc                óL   € V ^8„  d   QhR\         P                  P                  /# )r   r   )r   r   r   )r"   s   "r   r#   r#   L   s   € ÷ 'ñ '´·	±	×0FÑ0Fñ 'r   c           	     óü  € \        V \        P                  P                  4      '       g   \	        R\        V 4       R24      h. p\        V R4      '       g.   VP                  R\        P                  P                  RR/4       V P                  4        FJ  w  r#VP                  '       g   K  VP                  R\        P                  P                  RRV R2/4       KL  	  \        P                  P                  V 4      pV Fu  pR	V9   d2   VP                  R\        P                  P                  RR
V R2/4       RV9   g   KD  VP                  R\        P                   P                  RR
V R2/4       Kw  	  V# )zÜ
Generate a list of lints for a given torch script module.

Args:
    script_module: An instance of torch script module with type of ScriptModule.

Returns:
    lint_map: A list of dictionary that contains modules lints
r%   r&   Ú$_generate_bundled_inputs_for_forwardÚnameÚmessagez”No bundled input for forward, please add bundled inputs before saving the module using torch.utils.bundled_inputs.augment_model_with_bundled_inputs.zParam zw requires grad, please set torch.no_grad() to reduce memory usage and improve computation speed during inference phase.Údropoutz	Operator z� exists, remember to call eval() before saving the module and call torch.utils.mobile_optimizer.optimize_for_mobile to drop dropout operator.Ú
batch_normz� exists, remember to call eval() before saving the module and call torch.utils.mobile_optimizer.optimize_for_mobile to drop batch_norm operator.)r0   r   r   r   r1   r2   r(   Úappendr   r   rG   Únamed_parametersÚrequires_gradr   Úexport_opnamesr   r   )r   Ú	lint_listrG   ÚparamÚop_namesÚop_names   &     r   Úgenerate_mobile_module_lintsrS   L   sƒ  € ô �m¤U§Y¡Y×%;Ñ%;×<Ò<ÜØ”4˜Ó&Ð'Ð'FÐGóIð 	Ið €Iä�=Ð"H×IÒIØ×Ñ˜&¤(×"8Ñ"8×"=Ñ"=¸yð Kyð zô 	{ð %×5Ñ5Ö7‰ˆØ××ÒØ×Ñ˜f¤h×&<Ñ&<×&AÑ&AÀ9ÐPVÐW[ÐV\ð ]1ð O1ð 2ö 3ñ 8ô �y‰y×'Ñ'¨Ó6€HÛˆØ˜ÔØ×Ñ˜f¤h×&6Ñ&6×&;Ñ&;Ø'¨9°W°Ið >*ð **ð+ô ,ð ˜7Ö"Ø×Ñ˜f¤h×&8Ñ&8×&=Ñ&=Ø'¨9°W°Ið >*ð **ð+ö ,ñ ð Ðr   c                ó�   € V ^8„  d   QhR\         P                  P                  R\        \        ,          R\        \        ,          /# )r   r   r   r   )r   r   r   r   r    )r"   s   "r   r#   r#   u   s9   € ÷ %ñ %¼E¿I¹I×<RÑ<Rð %ÔgkÔloÕgpð %ÔuyÔz}Õu~ñ %r   c                 óx  € . p\        V R 4      '       d#   VP                  R 4       VP                  R4       \        V R4      '       dr   VP                  R4       V P                  4       pV FJ  pWA9  d   VP                  V4       VP                  RV,           4       VP                  RV,           4       KL  	  V# )Úget_all_bundled_inputsÚget_num_bundled_inputsÚ%get_bundled_inputs_functions_and_infoÚget_all_bundled_inputs_for_Ú_bundled_inputs_deflated_)r(   rK   rX   )r   r   r@   Úall_infoÚfunction_names   &&   r   r3   r3   u   s¯   € à "Ðäˆ}Ð6×7Ò7Ø!×(Ñ(Ð)AÔBØ!×(Ñ(Ð)AÔBô ˆ}ÐE×FÒFØ!×(Ñ(Ð)PÔQØ ×FÑFÓHˆÛ%ˆMØÔ5Ø)×0Ñ0°Ô?Ø%×,Ñ,Ð-JÈ]Õ-ZÔ[Ø%×,Ñ,Ð-HÈ=Õ-XÖYñ	 &ð %Ð$r   )NNÚCPU)Ú__doc__r   Úenumr   Útorch._Cr   r   Útypingr   r   rC   rS   r3   r   r   r   Ú<module>rb      s2   ðá Qã Ý Ý @Ý ôˆtô ÷:Fõz'÷R%r   