+
    åûj¹&  ã                  óX  a € 0 t $ R t^ RIHt ^ RIHt ^ RIt^ RIHt	H
t ^ RIHtHtHtHtHtHtHt ^ RIHtHt ]'       d   ^ RI t R R ltR	 R
 ltR R ltR R ltRs!R]"R&   Rs#R]"R&   Rs$R]"R&   R R lt%R^ /R R lltR^ /R R lltR R ltR R  ltR! R" ltR# R$ ltR% R& lt
R# )'z‹
This module contains pre-dispatch wrappers for functorch operations
that enable proper tracing in PT2 non-strict export/compile fx graph.
)Úannotations)ÚTYPE_CHECKINGN)Ú_enter_dual_levelÚ_exit_dual_level)Ú_add_batch_dimÚ_jvp_decrement_nestingÚ_jvp_increment_nestingÚ_remove_batch_dimÚ_unwrap_for_gradÚ_vmap_decrement_nestingÚ_vmap_increment_nesting)Ú
_make_dualÚ_unpack_dualc               ó(   € V ^8„  d   QhRRRRRRRR/# )é   Úselfútorch.TensorÚ	batch_dimÚintÚlevelÚreturn© )Úformats   "ÚXC:\Ai_Coding\apps\studio\ComfyUI\.venv\Lib\site-packages\torch\_functorch\predispatch.pyÚ__annotate__r   (   s(   € ÷ ñ ˜ð °#ð ¸cð Àlñ ó    c                óÎ   € ^ RI Hp V! 4       pV^ 8  d   V P                  V,           MTpV'       d(   \        P                  P                  \        V 3WV4      # \        WV4      pV# )zb
Thin wrapper around torch._C._add_batch_dim that is used to proxy in
PT2 export/compile fx graph
©Ú+_maybe_find_pre_dispatch_tf_mode_for_export)Útorch._export.utilsr   ÚndimÚtorchÚ	overridesÚhandle_torch_functionr   Ú_add_batch_dim_impl)r   r   r   r   ÚmodeÚress   &&&   r   r   r   (   s^   € õ
 Pá6Ó8€DØ)2°Q¬�—	‘	˜IÖ%¸I€IçÜ�‰×4Ñ4Ü˜T˜G T°eó
ð 	
ô ˜d¨uÓ
5€CØ€Jr   c          
     ó,   € V ^8„  d   QhRRRRRRRRRR/# )r   r   r   r   r   Ú
batch_sizeÚout_dimr   r   )r   s   "r   r   r   ;   s4   € ÷ ñ Ø
ðØ"ðØ03ðØ>Aðàñr   c                ó–   € ^ RI Hp V! 4       pV'       d(   \        P                  P	                  \
        V 3WW#4      # \        WW#4      pV# )ze
Thin wrapper around torch._C._remove_batch_dim that is used to proxy in
PT2 export/compile fx graph
r   )r   r   r!   r"   r#   r	   Ú_remove_batch_dim_impl)r   r   r(   r)   r   r%   r&   s   &&&&   r   r	   r	   ;   sH   € õ Pá6Ó8€DçÜ�‰×4Ñ4Ü ˜w¨°Zó
ð 	
ô ! ¨jÓ
B€CØ€Jr   c               ó$   € V ^8„  d   QhRRRRRR/# )r   r(   r   Ú
randomnessÚstrr   r   )r   s   "r   r   r   O   s!   € ÷ ñ ¨ð ¸ð Àñ r   c                ó’   € ^ RI Hp V! 4       pV'       d'   \        P                  P	                  \
        V 3W4      # \        W4      pV# )úd
Thin wrapper around torch._C._vmap_increment_nesting that is used
to proxy in export/compile graph
r   )r   r   r!   r"   r#   r   Ú_vmap_increment_nesting_impl)r(   r-   r   r%   r&   s   &&   r   r   r   O   sD   € õ
 Pá6Ó8€DçÜ�‰×4Ñ4Ü# j ]°Jó
ð 	
ô ' zÓ
>€CØ€Jr   c               ó   € V ^8„  d   QhRR/# ©r   r   r   r   )r   s   "r   r   r   `   s   € ÷ *ñ * ñ *r   c                 óˆ   € ^ RI Hp  V ! 4       pV'       d%   \        P                  P	                  \
        R4      # \        4       # )r0   r   r   )r   r   r!   r"   r#   r   Ú_vmap_decrement_nesting_impl©r   r%   s     r   r   r   `   s;   € õ
 Pá6Ó8€DçÜ�‰×4Ñ4Ü#Øó
ð 	
ô (Ó)Ð)r   FÚboolÚDECOMPOSITIONS_LOADEDzthreading.Lock | NoneÚDECOMPOSITIONS_LOCKztorch.library.Library | NoneÚVMAP_DECOMPOSITIONS_LIBc               ó   € V ^8„  d   QhRR/# )r   r   ÚNoner   )r   s   "r   r   r   w   s   € ÷ 7%ñ 7% $ñ 7%r   c                 óø  a€ ^ RI Hp  V ! 4       pV'       d%   \        P                  P	                  \
        R
4      # \        '       d   R# \        f   ^ RIpVP                  ! 4       s\        ;_uu_ 4        \        '       d    RRR4       R# \        P                  P                  RRR4      s^ RIHo R V3R llpV! \        P                  P                   P"                  P$                  4       V! \        P                  P                   P&                  P$                  4       V! \        P                  P                   P(                  P$                  4       V! \        P                  P                   P*                  P$                  4       V! \        P                  P                   P,                  P$                  4       V! \        P                  P                   P.                  P$                  4       V! \        P                  P                   P0                  P$                  4       V! \        P                  P                   P2                  P$                  4       R	sRRR4       R#   + '       g   i     R# ; i)z@
Lazy loading of vmap decompositions with pre-dispatch support.
r   NÚatenÚIMPLÚFuncTorchBatched)Údecomposition_tablec               ó    € V ^8„  d   QhRRRR/# )r   Údecompztorch._ops.OpOverloadr   r<   r   )r   s   "r   r   Ú.lazy_load_decompositions.<locals>.__annotate__›   s    € ÷ 	Qñ 	QÐ8Mð 	QÐRVñ 	Qr   c                ó’   <€ \         f   \        R4      hV S9   d    \         P                  V SV ,          4       R # \        RV  24      h)Nz(VMAP_DECOMPOSITIONS_LIB must not be Nonez!could not find decomposition for )r:   ÚAssertionErrorÚimplÚRuntimeError)rC   rA   s   &€r   Ú#_register_python_decomposition_vmapÚElazy_load_decompositions.<locals>._register_python_decomposition_vmap›   sG   ø€ Ü&Ò.Ü$Ð%OÓPÐPØÐ,Ô,Ü'×,Ñ,¨VÐ5HÈÕ5PÖQä"Ð%FÀvÀhÐ#OÓPÐPr   Tr   )r   r   r!   r"   r#   Úlazy_load_decompositionsr8   r9   Ú	threadingÚLockÚlibraryÚLibraryr:   Útorch._decomprA   Úopsr>   Úmse_loss_backwardÚdefaultÚsmooth_l1_loss_backwardÚhuber_loss_backwardÚnll_loss_forwardÚnll_loss2d_forwardÚnll_loss_backwardÚnll_loss2d_backwardÚaddr)r   r%   rL   rI   rA   s       @r   rK   rK   w   s“  ø€ õ Pá6Ó8€DçÜ�‰×4Ñ4Ô5MÈrÓRÐR÷ ÓÙô Ò"Ûà'ŸnšnÓ.Ðç	Ö	ß Ó Ø÷ 
Ñ	ô #(§-¡-×"7Ñ"7Ø�FÐ.ó#
Ðõ 	6÷	Qð 	Qñ 	,¬E¯I©I¯N©N×,LÑ,L×,TÑ,TÔUÙ+Ü�I‰I�N‰N×2Ñ2×:Ñ:ô	
ñ 	,¬E¯I©I¯N©N×,NÑ,N×,VÑ,VÔWÙ+¬E¯I©I¯N©N×,KÑ,K×,SÑ,SÔTÙ+¬E¯I©I¯N©N×,MÑ,M×,UÑ,UÔVÙ+¬E¯I©I¯N©N×,LÑ,L×,TÑ,TÔUÙ+¬E¯I©I¯N©N×,NÑ,N×,VÑ,VÔWÙ+¬E¯I©I¯N©N×,?Ñ,?×,GÑ,GÔHà $Ð÷C 
×	×	Ò	ús   Á4I(ÂGI(É(I9	r   c               ó(   € V ^8„  d   QhRRRRRRRR/# )r   Útensorr   Útangentr   r   r   r   )r   s   "r   r   r   ±   s,   € ÷ 9ñ 9Øð9Ø#/ð9Ø;>ð9àñ9r   c               ó–   € ^ RI Hp V! 4       pV'       d)   \        P                  P	                  \
        W3WVR7      # \        WVR7      # )zt
Thin wrapper around torch._VF._make_dual that is used to proxy in
PT2 export/compile fx graph for forward-mode AD.
r   ©r   )r   r   r!   r"   r#   r   Ú_make_dual_impl)r\   r]   r   r   r%   s   &&$  r   r   r   ±   sJ   € õ Pá6Ó8€DçÜ�‰×4Ñ4Ü˜Ð)¨6À%ð 5ó 
ð 	
ô ˜6°%Ô8Ð8r   c               ó$   € V ^8„  d   QhRRRRRR/# )r   r\   r   r   r   r   z!tuple[torch.Tensor, torch.Tensor]r   )r   s   "r   r   r   Ä   s$   € ÷ 2ñ 2Øð2Ø$'ð2à&ñ2r   c               ó’   € ^ RI Hp V! 4       pV'       d(   \        P                  P	                  \
        V 3WR7      # \        WR7      # )zv
Thin wrapper around torch._VF._unpack_dual that is used to proxy in
PT2 export/compile fx graph for forward-mode AD.
r   r_   )r   r   r!   r"   r#   r   Ú_unpack_dual_impl©r\   r   r   r%   s   &$  r   r   r   Ä   sE   € õ Pá6Ó8€DçÜ�‰×4Ñ4Ü˜6˜) Vð 5ó 
ð 	
ô ˜VÔ1Ð1r   c               ó   € V ^8„  d   QhRR/# r3   r   )r   s   "r   r   r   ×   ó   € ÷ )ñ ) ñ )r   c                 óˆ   € ^ RI Hp  V ! 4       pV'       d%   \        P                  P	                  \
        R4      # \        4       # )zƒ
Thin wrapper around torch._C._functorch._jvp_increment_nesting that is
used to proxy in export/compile graph for forward-mode AD.
r   r   )r   r   r!   r"   r#   r   Ú_jvp_increment_nesting_implr6   s     r   r   r   ×   ó;   € õ
 Pá6Ó8€DçÜ�‰×4Ñ4Ü"Øó
ð 	
ô 'Ó(Ð(r   c               ó   € V ^8„  d   QhRR/# r3   r   )r   s   "r   r   r   è   rf   r   c                 óˆ   € ^ RI Hp  V ! 4       pV'       d%   \        P                  P	                  \
        R4      # \        4       # )zƒ
Thin wrapper around torch._C._functorch._jvp_decrement_nesting that is
used to proxy in export/compile graph for forward-mode AD.
r   r   )r   r   r!   r"   r#   r   Ú_jvp_decrement_nesting_implr6   s     r   r   r   è   ri   r   c               ó$   € V ^8„  d   QhRRRRRR/# )r   r\   r   r   r   r   r   )r   s   "r   r   r   ù   s!   € ÷ 0ñ 0˜\ð 0°#ð 0¸,ñ 0r   c                óŽ   € ^ RI Hp V! 4       pV'       d'   \        P                  P	                  \
        V 3W4      # \        W4      # )zš
Thin wrapper around torch._C._functorch._unwrap_for_grad that is used
to proxy in PT2 export/compile fx graph for functorch transforms (grad, vjp, jvp).
r   )r   r   r!   r"   r#   r
   Ú_unwrap_for_grad_implrd   s   &&  r   r
   r
   ù   s@   € õ
 Pá6Ó8€DçÜ�‰×4Ñ4Ü˜v˜i¨ó
ð 	
ô ! Ó/Ð/r   c               ó   € V ^8„  d   QhRR/# r3   r   )r   s   "r   r   r   
  s   € ÷ $ñ $˜3ñ $r   c                 óˆ   € ^ RI Hp  V ! 4       pV'       d%   \        P                  P	                  \
        R4      # \        4       # )zz
Thin wrapper around torch._C._enter_dual_level that is used to proxy in
PT2 export/compile fx graph for forward-mode AD.
r   r   )r   r   r!   r"   r#   r   Ú_enter_dual_level_implr6   s     r   r   r   
  s4   € õ
 Pá6Ó8€DçÜ�‰×4Ñ4Ô5FÈÓKÐKÜ!Ó#Ð#r   c               ó    € V ^8„  d   QhRRRR/# )r   r   r   r   r<   r   )r   s   "r   r   r     s   € ÷ .ñ .˜sð . tñ .r   c                ó�   € ^ RI Hp V! 4       pV'       d'   \        P                  P	                  \
        RV R7      # \        V R7      # )zy
Thin wrapper around torch._C._exit_dual_level that is used to proxy in
PT2 export/compile fx graph for forward-mode AD.
r   r_   r   )r   r   r!   r"   r#   r   Ú_exit_dual_level_impl)r   r   r%   s   $  r   r   r     s<   € õ
 Pá6Ó8€DçÜ�‰×4Ñ4Ô5EÀrÐQVÐ4ÓWÐWÜ  uÔ-Ð-r   )&Ú__conditional_annotations__Ú__doc__Ú
__future__r   Útypingr   r!   Útorch._Cr   rr   r   ru   Útorch._C._functorchr   r$   r   rl   r   rh   r	   r+   r
   ro   r   r5   r   r1   Ú	torch._VFr   r`   r   rc   rL   r8   Ú__annotations__r9   r:   rK   )rv   s   @r   Ú<module>r~      s©   øðôõ
 #å  ã ÷÷÷ ñ ÷÷ Ûõõ&õ(õ"*ð$ $Ð �tÓ #Ø-1Ð Ð*Ó 1Ø8<Ð Ð5Ó <õ7%ðt9ØAB÷9ð&2Ø*+÷2õ&)õ")õ"0õ"$÷.r   