ó
    EñiE¥ ã                   óš  • % S r SSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSK	r	SSK
r
SSKrSSKrSSKrSSKJr  SSKJrJrJrJrJr  SSKJrJrJ r!  S\RD                  4S jr#SSK$J%r&J'r'J(r(  SS	K)J*r*J+r+J,r,J-r-J.r.  SS
K/J0r0  \(       a  SSK1J2r2J3r3  / SQr4\4\5" \45      :w  a  \6" S5      e SSK7J8r8  \8Rr                  " 5         C8\
R                  S:X  a  SÙS jr;\;" 5         C;S\<S\<S\<S\=\<   4S jr>SÚS\<S\<S\"SS4S jjr?SÛS\@S-  SS4S jjrASÙS jrB\.(       d  \R†                  " S5      (       ah  \	Rˆ                  " 5       S:w  aS  \
RŠ                  " 5       rF\
RŽ                  " \R�                  \R’                  -  5        SSKJ7  \
RŽ                  " \F5        CFO\-(       a  \B" 5         SSKJ7   " S S5      rK " S  S!5      rL " S" S#5      rMS$ rNS% rOS& rPS' rQS\R\R\SS(4   \R\SS(4   4   4S) jrTS* rUS+ rVS, rWS-u  rXrYrZS. H(  rYS/\Y 3rZ\W" \Y5      rX\Z=\Xl[        \Xl\        \X\]" 5       \Z'   M*     CXCYCZCW\]" 5       S0   r^\4R¿                  S15        S2 r`S3 ra SS4KJJbrb  SS6KhJcrc  S7u  rYri\j" \c5       H£  rY\YS   S8:w  ay  \YR×                  S95      (       dc  \4R¿                  \Y5        \l" \c\Y5      ri\m" \i5      (       d  \RÜ                  " \i5      (       a#  \iRÞ                  \\:w  a  \YS:;  a	  \\\ilo        M  M�  Mƒ  M…  \YS;:X  d  M�  \p" \
Râ                  \\   \Y5        M¥     CYCi\(       d  SÛS< jrr\r" \c5        CrS=\S\<4S> jrsS=\S\!S?   4S@ jrtS=\S\RD                  4SA jru\Rì                  " 5       qwSÜSB jrxSÝSD jrySE\SS?   \<-  SS4SF jrzSÞSG jr{SHSI.SJ\RD                  SK\RD                  SS4SL jjr|S\RD                  4SM jr}S\RD                  4SN jr~SO\Rþ                  \<-  SS4SP jr€S\Rþ                  4SQ jr�S\<4SR jr‚SS\<SS4ST jrƒSU\RD                  SS4SV jr„S\RD                  4SW jr…SX\RD                  \M-  SY\/ \<4   4SZ jr†SÛS[ jr‡\" S\\ˆS]9SÛSS^.S_ jj5       r‰SÛS` jrŠSÛSa jr‹SÛSb jrŒSÛSc jr�SÛSd jrŽSÛSe jr�SSfKJ�r�J‘r‘J’r’J“r“  Sr”S\•Sg'   \4GR-                  / ShQ5        SSiK—J˜r˜  SSjKhJ™r™  SSkKšJ›r›JœrœJ�r�JžržJŸrŸ   " Sl Sm\›5      r  " Sn So\›5      r¡ " Sp Sq\›5      r¢ " Sr Ss\›5      r£ " St Su\›5      r¤ " Sv Sw\›5      r¥ " Sx Sy\›5      r¦ " Sz S{\›5      r§ " S| S}\›5      r¨ " S~ S\›5      r© " S€ S�\›5      rª " S‚ Sƒ\›5      r« " S„ S…\›5      r¬ " S† S‡\›5      r­ " Sˆ S‰\›5      r® " SŠ S‹\›5      r¯ " SŒ S�\›5      r°\Ÿ\¡\¢\¤\¥\¦\§\ \£\¨\¬\­\®\©\«\ª\¯\°\ž1r±\²\S\ž\Ÿ-        \•SŽ'   \²" 5       r³\²\SS?      \•S�'   SS�KhJ´r´JµrµJ¶r¶  SS‘K·J¸r¸  SS’K¹JºrºJ»r»  SS“K¼J½r½J¾r¾J¿r¿JÀrÀJÁrÁ  SS”KÂJÃrÃJÄrÄ  S• rÅ\cRÄ                  " \Å" 5       5        CÅ\(       a  SSKÆ7  \ÇrÈCÇS–rÉS7u  rYri\j" \cGR”                  5       H†  rY\YGR—                  S—5      (       d  \Y\É;   a  M"  \l" \cGR”                  \Y5      ri\\\ilo        \YS˜:X  a  \i\]" 5       \Y'   S8\Y-   rY\i\]" 5       \Y'   \YGR—                  S85      (       a  Mu  \4R¿                  \Y5        Mˆ     CYCiSSKhrh\4GR-                  S™ \j" \h5       5       5        SSšKÌJÍrÍ  SS›KhJÎrÎJÏrÏ  SSKÐ7  CœC›Sœ rÑSS�KÒJÓrÓJÔrÔJÕrÕJÖrÖ  SSžKhJ×r×JØrØJÙrÙJÚrÚJÛrÛJÜrÜJÝrÝJÞrÞJßrßJàràJáráJârâJãrãJäräJåråJæræJçrçJèrèJéréJêrêJërëJìrìJíríJîrîJïrïJðrðJñrñJòròJóróJôrô  SSŸKõJörö  SS KhJ÷r÷  SSKørhSSKùrhSSKúrhSSKûrh\cGRø                  " \=" \±5      5        SS¡KhJýrýJþrþJÿrÿGJ Gr   GC CÿCþCýS\RD                  4S¢ jGrSS£KhGJGrGJGr  SS¤GKGJGr  SS¥GKGJGr  \
Râ                  GR                  \\ S¦3G\5        \
Râ                  GR                  \\ S§3G\5        SS¨KhGJ	Gr	  SS©KhGJ
Gr
  G\GrSSªGKGJGr  G\" \hGR                  5        GCSS«GKGJGr  G\GR$                  GR&                  GrG\GR$                  GR(                  GrSS¬KhGJGr  SS­GKGJGrGJGrGJGrGJGrGJGr  SS®GKGJGrGJGr   " S¯ S°5      Gr  " S± S²G\ 5      Gr! " S³ S´5      Gr"\" Sµ5      Gr#\" S¶5      Gr$\SHSS·SSSHS¸.S¹\G\#G\$4   Sº\RD                  S»\RD                  S-  S¼\<\-  SJ\<S-  S½G\%\<\<\Rþ                  -  \RD                  -  \-  4   S-  S¾\RD                  S\G\#G\$4   4S¿ jj5       Gr&\ SÛSHSS·SSSHS¸.S¹SSº\RD                  S»\RD                  S-  S¼\<\-  SJ\<S-  S½G\%\<\<\Rþ                  -  \RD                  -  \-  4   S-  S¾\RD                  S\\G\#G\$4   /\G\#G\$4   4   4SÀ jjj5       Gr& SÛSHSS·SSSHS¸.S¹\G\#G\$4   S-  Sº\RD                  S»\RD                  S-  S¼\<\-  SJ\<S-  S½G\%\<\<\Rþ                  -  \RD                  -  \-  4   S-  S¾\RD                  S\\G\#G\$4   /\G\#G\$4   4   \G\#G\$4   -  4SÁ jjjGr&SÂ Gr'SSÃKhGJ(Gr(GJ)Gr)GJ*Gr*GJ+Gr+  SSÄGK,GJ-Gr-GJ.Gr.  SSÅGK/GJ0Gr0  \(       d/  G\1" \hRÆ                  SÆ5      (       a  SSGK2Jßs  GJ3Gr4  GC4SSÇKhGJ3Gr3  SÈ\GRj                  ;   a  SSGK6JÞs  GJ7Gr8  G\8GRr                  " 5         SSGK:rhSSÉKhGJ;Gr;  \hGR¸                  GRÌ                  GRy                  5         SSÊKhGJ=Gr=   " SË SÌ5      Gr>\hGR¸                  GRÌ                  GR~                  \hGR¸                  GR¼                  GR~                  \hGR¸                  GR€                  GR‚                  \hGR¸                  GR„                  GR‚                  SÍ.GrC\(       a  SSÎKhGJDGrDGJEGrEGJFGrFGJGGrG  O	1 SÏkGrHSÐ GrI\GR”                  SÛSC\hGR–                  \<-  S-  4SÑ jj5       GrL  SßSÒ\Rþ                  S-  SÓ\Rþ                  S-  4SÔ jjGrMSSÕKhGJNGrN  G\NGRž                  " 5         SÖ GrPS\RD                  4S× jGrQSØ GrRG\Q" 5       (       a	  G\P" 5         gg! \: a     GN¿f = f! \: a<    SSKJJcrd  \dRÊ                  c'  \:" \RÌ                  " S55      RÏ                  5       5      See f = f)àa�  
The torch package contains data structures for multi-dimensional
tensors and defines mathematical operations over these tensors.
Additionally, it provides many utilities for efficient serialization of
Tensors and arbitrary types, and other useful utilities.

It has a CUDA counterpart, that enables you to run your tensor computations
on an NVIDIA GPU with compute capability >= 3.0.
é    N)ÚCallable)ÚAnyÚ
get_originÚoverloadÚTYPE_CHECKINGÚTypeVar)Ú
deprecatedÚ	ParamSpecÚTypeIsÚreturnc                  ó   • g)NF© r   ó    ÚK/home/mande/repo/quber/.venv/lib/python3.13/site-packages/torch/__init__.pyÚ_running_with_deployr   ,   s   € Ør   )Ú_functionalize_syncÚ_import_dotted_nameÚclassproperty)Úget_file_pathÚ#prepare_multiprocessing_environmentÚ1profiler_allow_cudagraph_cupti_lazy_reinit_cuda12ÚUSE_GLOBAL_DEPSÚUSE_RTLD_GLOBAL_WITH_LIBTORCH)Ú__version__)ÚDeviceÚIntLikeType)GÚBoolStorageÚ
BoolTensorÚByteStorageÚ
ByteTensorÚCharStorageÚ
CharTensorÚDoubleStorageÚDoubleTensorÚFloatStorageÚFloatTensorÚ
GradScalerÚ
IntStorageÚ	IntTensorÚLongStorageÚ
LongTensorÚShortStorageÚShortTensorÚSymBoolÚSymFloatÚSymIntÚTensorÚTypedStorageÚUntypedStorageÚ$are_deterministic_algorithms_enabledÚautocastÚchunkÚcompileÚcondÚenable_gradÚexportÚget_default_deviceÚget_deterministic_debug_modeÚget_device_moduleÚget_float32_matmul_precisionÚget_rng_stateÚinference_modeÚinitial_seedÚ-is_deterministic_algorithms_warn_only_enabledÚ
is_storageÚ	is_tensorÚis_warn_always_enabledÚloadÚlobpcgÚmanual_seedÚmatmulÚno_gradÚrandÚrandnÚsaveÚseedÚset_default_deviceÚset_default_tensor_typeÚset_deterministic_debug_modeÚset_float32_matmul_precisionÚset_printoptionsÚset_rng_stateÚset_warn_alwaysÚsplitÚstackÚ	sym_floatÚsym_fresh_sizeÚsym_intÚsym_iteÚsym_maxÚsym_minÚsym_notÚsym_sumÚtypenameÚunravel_indexÚuse_deterministic_algorithmsÚvmapz__all__ must be kept sortedé   )Ú
_rocm_initÚwin32c            
      ó�
  • SS K n SSKJn  [        R                  " SS5      n[        R
                  R                  [        R                  SS5      n[        R
                  R                  [        R
                  R                  [        5      S5      n[        R
                  R                  U R                  S5      SS5      n[        R
                  R                  [        R                  S5      n[        R                  [        R                  :w  a0  [        R
                  R                  [        R                  SS5      nOS	nUUUUU4 Vs/ s H+  n[        R
                  R                  U5      (       d  M)  UPM-     n	n[        R                  " S
 U	 5       5      (       dV  [        R
                  R                  [        R                  " S[        R
                  R                  USS5      5      SS5      n
OS	n
U(       a“  [        R                   " S U	 5       5      (       aq  UR#                  SS5      nSU-   n[        R
                  R                  USSSU 35      n[        R
                  R                  [        R                  " XÍ5      S5      nOS	nU	R%                  S X®4 5       5        [&        R(                  " SSS9n[+        US5      nUR-                  S5      n[&        R.                  UR0                  l        U(       a  [&        R.                  UR4                  l        U	 H  n[        R6                  " U5        M      [&        R8                  " S5        [&        R8                  " S5        [:        R<                  " 5       S:w  a  [&        R8                  " S5        [H        RH                  " [        R
                  R                  US!5      5      nS"nU GH  nS"nU(       ag  UR5                  US S#5      n[&        RJ                  " 5       nUc7  US$:w  a1  [&        RL                  " U5      nU=RN                  S%U S&3-  sl'        UeUb  SnU(       a  M}  U(       d9  S'R                  U	[        RP                  S(   /-   5      [        RP                  S('   SnUR1                  U5      nUb  MÓ  [&        RL                  " [&        RJ                  " 5       5      nU=RN                  S%U S&3-  sl'        Ue   UR-                  U5        g s  snf ! [>         a1    [A        [B        RD                  " S 5      RG                  5       5         GN¢f = f))Nr   ©ÚcudaÚProgramFileszC:\Program FilesÚLibraryÚbinÚlibÚuserbaseÚ c              3   óœ   #   • U  HB  n[         R                  R                  [         R                  R                  US 5      5      v •  MD     g7f)znvToolsExt64_1.dllN)ÚosÚpathÚexistsÚjoin©Ú.0Úps     r   Ú	<genexpr>Ú&_load_dll_libraries.<locals>.<genexpr>È   s3   é € ð 
ÚKTÀaŒB�G‰G�N‰Nœ2Ÿ7™7Ÿ<™<¨Ð+?Ó@×AÐAÊ9ùs   ‚A
AÚNVTOOLSEXT_PATHzNVIDIA CorporationÚ
NvToolsExtÚx64c              3   ó”   #   • U  H>  n[         R                   " [        R                  R                  US 5      5      (       + v •  M@     g7f)zcudart64*.dllN)Úglobrq   rr   rt   ru   s     r   rx   ry   Ö   s1   é € ð )
ÚENÀ”—	’	œ"Ÿ'™'Ÿ,™, q¨/Ó:Ó;×;Ñ;ÂYùs   ‚AAÚ.Ú_ÚCUDA_PATH_VzNVIDIA GPU Computing ToolkitÚCUDAÚvc              3   ór   #   • U  H-  n[         R                  R                  U5      (       d  M)  Uv •  M/     g 7f©N)rq   rr   rs   ru   s     r   rx   ry   â   s%   é € ð 
Ú7�!¼2¿7¹7¿>¹>È!×;L�A‰AÒ7ùs   ‚(7®	7zkernel32.dllT)Úuse_last_errorÚAddDllDirectoryrd   zvcruntime140.dllzmsvcp140.dllÚARM64zvcruntime140_1.dllzâ
                    Microsoft Visual C++ Redistributable is not installed, this may lead to the DLL load failure.
                    It can be downloaded at https://aka.ms/vs/17/release/vc_redist.x64.exe
                    z*.dllFi   é~   z Error loading "z" or one of its dependencies.Ú;ÚPATH))Ú	sysconfigÚtorch.versionri   rq   Úgetenvrr   rt   ÚsysÚexec_prefixÚdirnameÚ__file__Úget_config_varÚbase_exec_prefixrs   ÚbuiltinsÚanyÚallÚreplaceÚextendÚctypesÚWinDLLÚhasattrÚSetErrorModeÚc_void_pÚLoadLibraryWÚrestypeÚLoadLibraryExWÚadd_dll_directoryÚCDLLÚplatformÚmachineÚOSErrorÚprintÚtextwrapÚdedentÚstripr~   Úget_last_errorÚWinErrorÚstrerrorÚenviron)rŒ   Úcuda_versionÚpfiles_pathÚpy_dll_pathÚth_dll_pathÚusebase_pathÚpy_root_bin_pathÚbase_py_dll_pathrw   Ú	dll_pathsÚnvtoolsext_dll_pathÚcuda_version_1Úcuda_path_varÚdefault_pathÚ	cuda_pathÚkernel32Úwith_load_library_flagsÚprev_error_modeÚdll_pathÚdllsÚpath_patchedÚdllÚ	is_loadedÚresÚ
last_errorÚerrs                             r   Ú_load_dll_librariesrÇ   ¦   s5  € Ûå6ä—i’i Ð0CÓDˆÜ—g‘g—l‘l¤3§?¡?°I¸uÓEˆÜ—g‘g—l‘l¤2§7¡7§?¡?´8Ó#<¸eÓDˆÜ—w‘w—|‘|Ø×$Ñ$ ZÓ0°)¸Uó
ˆô Ÿ7™7Ÿ<™<¬¯©¸Ó?Ðô �?‰?œc×2Ñ2Ó2Ü!Ÿw™wŸ|™|¬C×,@Ñ,@À)ÈUÓSÑà!Ðð
 ØØ ØØ ñó

ò�ô �w‰w�~‰~˜a× ÷ ñð 	ð 

ô �|Š|ñ 
ÙKTó
÷ 
ñ 
ô #%§'¡'§,¡,Ü—	’	Ø%Ü—G‘G—L‘L Ð.BÀLÓQóð Øó#Ñð #%ÐæœHŸLšLñ )
ÙENó)
÷ 
ñ 
ð *×1Ñ1°#°sÓ;ˆNØ)¨NÑ:ˆMÜŸ7™7Ÿ<™<ØÐ;¸VÀqÈÈÐEWóˆLô Ÿ™Ÿ™¤R§Y¢Y¨}Ó%KÈUÓS‰IàˆIà×Ññ 
Ø+Ñ7ó
ô 	
ô —=’= ÀÑEˆÜ")¨(Ð4EÓ"FÐØ"×/Ñ/°Ó7ˆä(.¯©ˆ×ÑÔ%Þ"Ü.4¯o©oˆH×#Ñ#Ô+ã!ˆHÜ× Ò  Ö*ñ "ð	Ü�KŠKÐ*Ô+Ü�KŠK˜Ô'Ü×ÒÓ! WÓ,Ü—’Ð0Ô1ô �yŠyœŸ™Ÿ™ k°7Ó;Ó<ˆØˆÜˆCØˆIÞ&Ø×-Ñ-¨c°4¸ÓD�Ü#×2Ò2Ó4�
Ø‘; :°Ó#4Ü Ÿ/š/¨*Ó5�CØ—L’LØ*¨3¨%Ð/LÐMñ•Lð �IØ‘_Ø $�Iß�9Þ#Ø),¯©°)¼r¿z¹zÈ&Ñ?QÐ>RÑ2RÓ)S”B—J‘J˜vÑ&Ø#'�LØ×+Ñ+¨CÓ0�Ø“;Ü Ÿ/š/¬&×*?Ò*?Ó*AÓB�CØ—L’LØ*¨3¨%Ð/LÐMñ•Lð �Iñ/ ð2 	×Ñ˜oÕ.ùò

øôt ó 	ÜÜ—’ðó÷
 ‘%“'÷ð	ús   Å(TÅ9TÍAT
 Ô
7UÕUrr   Ú
lib_folderÚlib_namec           
      ó–  • SSK Jn  [        R                  " [        R                  R                  U SUSU5      5      nUbQ  UR                  S5      S   nU[        R                  " [        R                  R                  U SSU 3SU5      5      -  n[        R                  " [        R                  R                  XSU5      5      nXF-   $ )Nr   rh   Únvidiarm   r   Úcu)r�   ri   r~   rq   rr   rt   rV   )rr   rÈ   rÉ   r¯   Únvidia_lib_pathsÚmaj_cuda_versionÚ	lib_pathss          r   Ú_get_cuda_dep_pathsrÐ   !  s­   € õ
 3ä—y’yÜ
�‰�‰�T˜8 Z°¸ÓAóÐð ÑØ'×-Ñ-¨cÓ2°1Ñ5ÐØœDŸIšIÜ�G‰G�L‰L˜˜x¨2Ð.>Ð-?Ð)@À%ÈÓRó
ñ 	
Ðô —	’	œ"Ÿ'™'Ÿ,™, t¸ÀÓIÓJ€IàÑ'Ð'r   Úrequiredc                 ór  • [         R                  " 5       S:w  a!  [        S[         R                  " 5        35      eSn[        R                   H  n[        X@U5      nU(       d  M  US   n  O   U(       d%  U(       a  [        U S[        R                   35      eU(       a  [        R                  " U5        gg)z9Preloads cuda library if it could not be found otherwise.ÚLinuxz$Should only be called on Linux, got Nr   z not found in the system path )	r¤   ÚsystemÚAssertionErrorr�   rr   rÐ   Ú
ValueErrorrš   r£   )rÈ   rÉ   rÑ   Úlib_pathrr   Úcandidate_lib_pathss         r   Ú_preload_cuda_librÙ   5  s—   € ô ‡‚Ó˜GÓ#ÜÐCÄHÇOÂOÓDUÐCVÐWÓXÐXà€HÜ—”ˆÜ1°$ÀHÓMÐßÐØ*¨1Ñ-ˆHÙñ	 ö
 žÜ˜H˜:Ð%CÄCÇHÁHÀ:ÐNÓOÐOÞÜ�Š�HÕð r   rÆ   c                 óì   • / SQnU bF  U VVs/ s H/  u  p#UR                  SS5      S   U R                  S   ;   d  M-  UPM1     snn(       d  U eU H  u  pE[        XE5        M     [        SSSS9  g s  snnf )	N))ÚcublaszlibcublasLt.so.*[0-9])rÛ   zlibcublas.so.*[0-9])Úcudnnzlibcudnn.so.*[0-9])Ú
cuda_nvrtczlibnvrtc.so.*[0-9])rÝ   zlibnvrtc-builtins.so.*[0-9])Úcuda_runtimezlibcudart.so.*[0-9])Ú
cuda_cuptizlibcupti.so.*[0-9])Úcufftzlibcufft.so.*[0-9])Úcurandzlibcurand.so.*[0-9])Ú	nvjitlinkzlibnvJitLink.so.*[0-9])Úcusparsezlibcusparse.so.*[0-9])Ú
cusparseltzlibcusparseLt.so.*[0-9])Úcusolverzlibcusolver.so.*[0-9])Úncclzlibnccl.so.*[0-9])Únvshmemzlibnvshmem_host.so.*[0-9])Úcufilezlibcufile.so.*[0-9]r   rd   r   ÚnvtxzlibnvToolsExt.so.*[0-9]F)rÑ   )rV   ÚargsrÙ   )rÆ   Ú	cuda_libsr€   rm   rÈ   rÉ   s         r   Ú_preload_cuda_depsrì   G  s   € ò(€Ið0 �Ù#ô Ú#‘� s§y¡y°°aÓ'8¸Ñ';¸s¿x¹xÈ¹{Ñ'J�™)÷ ð  ð ˆ	ó !*Ñˆ
Ü˜*Ö/ñ !*ô �fÐ7À%ÓHùó s
   �,A0½A0c                  ó¾  • [         R                  " 5       S:X  a  g [         R                  " 5       S:X  a  SOSn SU  3n[        R                  R	                  [
        5      n[        R                  R                  [        R                  R                  U5      SU5      n [        R                  " U[        R                  S9   [        S5       nUR                  5       nS S S 5        S	W;  a  g [        5         g ! , (       d  f       N = f! [         a     g f = f! [         a8  n[        U5        [        R                  " U[        R                  S9   S nAg S nAff = f)
NÚWindowsÚDarwinz.dylibz.soÚlibtorch_global_depsrm   )Úmodez/proc/self/mapszlibcudart.so)r¤   rÔ   rq   rr   Úabspathr’   rt   r‘   rš   r£   ÚRTLD_GLOBALÚopenÚreadrì   Ú	Exceptionr¦   )Úlib_extrÉ   ÚhereÚglobal_deps_lib_pathÚfÚ_mapsrÆ   s          r   Ú_load_global_depsrü   n  s	  € Ü‡‚Ó˜IÓ%Øô #Ÿ/š/Ó+¨xÓ7‰h¸U€GØ% g YÐ/€HÜ�7‰7�?‰?œ8Ó$€DÜŸ7™7Ÿ<™<¬¯©¯©¸Ó(=¸uÀhÓOÐðCÜ�ŠÐ(¬v×/AÑ/AÒBð
	ÜÐ'Ô(¨AØŸ™›�÷ )ð  UÓ*ØäÕ ÷ )Õ(ûô ó 	Ùð	ûô ó Cô 	˜3ÔÜ�ŠÐ(¬v×/AÑ/A×Bûð	CúsT   Â#D ÃD
 ÃC9ÃD
 Ã.
D
 Ã9
DÄD
 Ä

DÄD ÄDÄD Ä
EÄ$.EÅEÚTORCH_USE_RTLD_GLOBALrî   )Ú*c                   ó@  • \ rS rSrSrS rS rS rS rS0S jr	S	 r
S
 rS rS rS rS rS\S\R$                  4S jrS\R$                  4S jrS\R$                  4S jrS\R$                  4S jrS\R$                  4S jrS1S jrS1S jrS1S jrS2S jrS1S jrS1S jrS1S jrS3S jrS3S jr S3S jr!S3S  jr"S! r#S" r$S# r%S$ r&S2S% jr'S2S& jr(S1S' jr)S1S( jr*S) r+S* r,S\RZ                  4S+ jr.S\/S \RZ                  4   4S, jr0S\RZ                  4S- jr1S1S. jr2S/r3g)4r0   i½  z·
Like an int (including magic methods), but redirects all operations on the
wrapped node. This is used in particular to symbolically record operations
in the symbolic shape workflow.
c                 ó   • Xl         g r…   ©Únode©Úselfr  s     r   Ú__init__ÚSymInt.__init__Ä  ó	   € ð �	r   c                 ó4   • [         R                  " U S:g  5      $ ©Nr   )r•   Úbool©r  s    r   Ú__bool__ÚSymInt.__bool__É  s   € Ü�}Š}˜T Q™YÓ'Ð'r   c                 ó6   • U R                   R                  5       $ r…   ©r  Úint_r  s    r   Ú__int__ÚSymInt.__int__Ì  ó   € Ø�y‰y�~‰~ÓÐr   c                 ó6   • U R                   R                  5       $ r…   r  r  s    r   Ú	__index__ÚSymInt.__index__Ï  r  r   Nc                 ó   • U $ r…   r   )r  Úndigitss     r   Ú	__round__ÚSymInt.__round__Ô  ó   € Øˆr   c                 óø   • [        U[        R                  [        45      (       a  [	        U 5      R                  U5      $ [        U[        R                  [        45      (       d  [        $ U R                  U5      $ r…   )
Ú
isinstancer•   Úfloatr/   rX   Ú__float_truediv__Úintr0   ÚNotImplementedÚ__int_truediv__©r  Úothers     r   Ú__truediv__ÚSymInt.__truediv__×  sZ   € Ü�eœhŸn™n¬hÐ7×8Ñ8Ü˜T“?×4Ñ4°UÓ;Ð;Ü˜%¤(§,¡,´Ð!7×8Ñ8Ü!Ð!Ø×#Ñ# EÓ*Ð*r   c                 óø   • [        U[        R                  [        45      (       a  [	        U 5      R                  U5      $ [        U[        R                  [        45      (       d  [        $ U R                  U5      $ r…   )
r  r•   r  r/   rX   Ú__rfloat_truediv__r   r0   r!  Ú__rint_truediv__r#  s     r   Ú__rtruediv__ÚSymInt.__rtruediv__Þ  sZ   € Ü�eœhŸn™n¬hÐ7×8Ñ8Ü˜T“?×5Ñ5°eÓ<Ð<Ü˜%¤(§,¡,´Ð!7×8Ñ8Ü!Ð!Ø×$Ñ$ UÓ+Ð+r   c                 ó  • [        U[        R                  [        45      (       a+  [	        [
        R                  " [	        U 5      U-  5      5      $ [        U[        R                  [        45      (       d  [        $ U R                  U5      $ r…   )r  r•   r  r/   rX   ÚmathÚfloorr   r0   r!  Ú__int_floordiv__r#  s     r   Ú__floordiv__ÚSymInt.__floordiv__å  sb   € Ü�eœhŸn™n¬hÐ7×8Ñ8ÜœTŸZšZ¬	°$«¸%Ñ(?Ó@ÓAÐAÜ˜%¤(§,¡,´Ð!7×8Ñ8Ü!Ð!Ø×$Ñ$ UÓ+Ð+r   c                 ó  • [        U[        R                  [        45      (       a+  [	        [
        R                  " U[	        U 5      -  5      5      $ [        U[        R                  [        45      (       d  [        $ U R                  U5      $ r…   )r  r•   r  r/   rX   r-  r.  r   r0   r!  Ú__rint_floordiv__r#  s     r   Ú__rfloordiv__ÚSymInt.__rfloordiv__ì  sb   € Ü�eœhŸn™n¬hÐ7×8Ñ8ÜœTŸZšZ¨´	¸$³Ñ(?Ó@ÓAÐAÜ˜%¤(§,¡,´Ð!7×8Ñ8Ü!Ð!Ø×%Ñ% eÓ,Ð,r   c                 óJ  • [        U[        R                  [        45      (       a  [	        U 5      R                  U5      $ [        U[        R                  [        45      (       d  [        $ US:¼  a  U R                  U5      $ [	        U 5      R                  [	        U5      5      $ r	  )
r  r•   r  r/   rX   Ú__pow__r   r0   r!  Ú__pow_by_natural__r#  s     r   r7  ÚSymInt.__pow__÷  s   € Ü�eœhŸn™n¬hÐ7×8Ñ8Ü˜T“?×*Ñ*¨5Ó1Ð1Ü˜%¤(§,¡,´Ð!7×8Ñ8Ü!Ð!ð �A‹:Ø×*Ñ*¨5Ó1Ð1ô ˜T“?×*Ñ*¬9°UÓ+;Ó<Ð<r   c                 óJ  • [        U[        R                  [        45      (       a  [	        U 5      R                  U5      $ [        U[        R                  [        45      (       d  [        $ U S:¼  a  U R                  U5      $ [	        U 5      R                  [	        U5      5      $ r	  )
r  r•   r  r/   rX   Ú__rpow__r   r0   r!  Ú__rpow_by_natural__r#  s     r   r;  ÚSymInt.__rpow__  s{   € Ü�eœhŸn™n¬hÐ7×8Ñ8Ü˜T“?×+Ñ+¨EÓ2Ð2Ü˜%¤(§,¡,´Ð!7×8Ñ8Ü!Ð!Ø�1‹9Ø×+Ñ+¨EÓ2Ð2ä˜T“?×+Ñ+¬I°eÓ,<Ó=Ð=r   r$  r   c                 ó   • [        S5      e©Nútype stub not overridden©Ú	TypeErrorr#  s     r   Ú__eq__ÚSymInt.__eq__  ó   € ÜÐ2Ó3Ð3r   c                 ó   • [        S5      er?  rA  r#  s     r   Ú__lt__ÚSymInt.__lt__  rE  r   c                 ó   • [        S5      er?  rA  r#  s     r   Ú__gt__ÚSymInt.__gt__  rE  r   c                 ó   • [        S5      er?  rA  r#  s     r   Ú__le__ÚSymInt.__le__"  rE  r   c                 ó   • [        S5      er?  rA  r#  s     r   Ú__ge__ÚSymInt.__ge__%  rE  r   c                 ó   • [        S5      er?  rA  r#  s     r   Ú__add__ÚSymInt.__add__(  rE  r   c                 ó   • [        S5      er?  rA  r#  s     r   Ú__radd__ÚSymInt.__radd__+  rE  r   c                 ó   • [        S5      er?  rA  r#  s     r   Ú__rmul__ÚSymInt.__rmul__.  rE  r   c                 ó   • [        S5      er?  rA  r#  s     r   Ú__mod__ÚSymInt.__mod__1  rE  r   c                 ó   • [        S5      er?  rA  r#  s     r   Ú__mul__ÚSymInt.__mul__4  rE  r   c                 ó   • [        S5      er?  rA  r#  s     r   r8  ÚSymInt.__pow_by_natural__7  rE  r   c                 ó   • [        S5      er?  rA  r#  s     r   r<  ÚSymInt.__rpow_by_natural__:  rE  r   c                 ó   • [        S5      er?  rA  r#  s     r   r"  ÚSymInt.__int_truediv__=  rE  r   c                 ó   • [        S5      er?  rA  r#  s     r   r)  ÚSymInt.__rint_truediv__@  rE  r   c                 ó   • [        S5      er?  rA  r#  s     r   r/  ÚSymInt.__int_floordiv__C  rE  r   c                 ó   • [        S5      er?  rA  r#  s     r   r3  ÚSymInt.__rint_floordiv__F  rE  r   c                 ó   • [        S5      er?  rA  r#  s     r   Ú__sym_max__ÚSymInt.__sym_max__I  rE  r   c                 ó   • [        S5      er?  rA  r#  s     r   Ú__sym_min__ÚSymInt.__sym_min__L  rE  r   c                 ó   • [        S5      er?  rA  r  s    r   Ú__sym_float__ÚSymInt.__sym_float__O  rE  r   c                 ó   • [        S5      er?  rA  r  s    r   Ú__neg__ÚSymInt.__neg__R  rE  r   c                 ó   • [        S5      er?  rA  r#  s     r   Ú__sub__ÚSymInt.__sub__U  rE  r   c                 ó   • [        S5      er?  rA  r#  s     r   Ú__rsub__ÚSymInt.__rsub__X  rE  r   c                 ó   • [        S5      er?  rA  r#  s     r   Ú__and__ÚSymInt.__and__[  rE  r   c                 ó   • [        S5      er?  rA  r#  s     r   Ú__or__ÚSymInt.__or__^  rE  r   c                 ó6   • U R                   R                  5       $ r…   ©r  Ú_graph_reprr  s    r   Ú__repr__ÚSymInt.__repr__a  ó   € Ø�y‰y×$Ñ$Ó&Ð&r   c                 ó.   • U R                   R                  $ r…   ©r  Úexprr  s    r   Ú_sympy_ÚSymInt._sympy_d  ó   € Ø�y‰y�~‰~Ðr   c                 óœ   • U R                   R                  5       (       a#  [        U R                   R                  5       5      $ [	        S5      e)Nz"unhashable type: non-nested SymInt)r  Úis_nested_intÚhashÚ
nested_intrB  r  s    r   Ú__hash__ÚSymInt.__hash__g  s;   € Ø�9‰9×"Ñ"×$Ñ$Ü˜Ÿ	™	×,Ñ,Ó.Ó/Ð/ô Ð@ÓAÐAr   c                 ó
   • U S4$ )z,Represent this int as an exact integer ratiord   r   r  s    r   Úas_integer_ratioÚSymInt.as_integer_ratios  s   € à�Qˆwˆr   c                 óJ   • [         R                  " U 5      R                  5       $ r…   )r•   r   Ú
bit_lengthr  s    r   r›  ÚSymInt.bit_lengthw  s   € ô
 �|Š|˜DÓ!×,Ñ,Ó.Ð.r   c                 ó   • U $ r…   r   r  s    r   Ú	conjugateÚSymInt.conjugate~  r  r   r  r…   )r   r0   )r$  r   r   r0   ©r   r/   )4Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r  r  r  r  r  r%  r*  r0  r4  r7  r;  Úobjectr•   r
  rC  rG  rJ  rM  rP  rS  rV  rY  r\  r_  r8  r<  r"  r)  r/  r3  rn  rq  rt  rw  rz  r}  r€  rƒ  rˆ  rŽ  r   r•  Útupler˜  r›  rž  Ú__static_attributes__r   r   r   r0   r0   ½  s?  † ñòò
(ò ò ô
ò+ò,ò,ò-ò=ò0>ð4˜Fð 4 x§}¡}ô 4ð4˜xŸ}™}ô 4ð4˜xŸ}™}ô 4ð4˜xŸ}™}ô 4ð4˜xŸ}™}ô 4ô4ô4ô4ô4ô4ô4ô4ô4ô4ô4ô4ò4ò4ò4ò4ô4ô4ô4ô4ò'òðB˜(Ÿ,™,ô Bð %¨°(·,±,Ð(>Ñ"?ô ð/˜HŸL™Lô /÷r   r0   c                   ó²  • \ rS rSrSrS rS rS rS rS r	S r
S	 rS
 rS rS rS\S\R"                  4S jrS\R"                  4S jrS\R"                  4S jrS\R"                  4S jrS\R"                  4S jrS%S jrS%S jrS%S jrS%S jrS rS rS rS rS rS\ \RB                  \RB                  4   4S jr"S r#S r$S  r%S%S! jr&S\'4S" jr(S#r)g$)&r/   i‚  z¸
Like a float (including magic methods), but redirects all operations on the
wrapped node. This is used in particular to symbolically record operations
in the symbolic shape workflow.
c                 ó   • Xl         g r…   r  r  s     r   r  ÚSymFloat.__init__‰  r  r   c                 ó´   • [        U[        R                  [        R                  [        [
        45      (       d  [        $ U R                  [        U5      5      $ r…   )	r  r•   r   r  r0   r/   r!  r  rX   r#  s     r   r%  ÚSymFloat.__truediv__Ž  s<   € Ü˜%¤(§,¡,´·±ÄÌÐ!Q×RÑRÜ!Ð!Ø×%Ñ%¤i°Ó&6Ó7Ð7r   c                 ó´   • [        U[        R                  [        R                  [        [
        45      (       d  [        $ U R                  [        U5      5      $ r…   )	r  r•   r   r  r0   r/   r!  r(  rX   r#  s     r   r*  ÚSymFloat.__rtruediv__“  s<   € Ü˜%¤(§,¡,´·±ÄÌÐ!Q×RÑRÜ!Ð!Ø×&Ñ&¤y°Ó'7Ó8Ð8r   c                 óÖ   • [        U[        R                  [        R                  [        [
        45      (       d  [        $ [        [        R                  " U [        U5      -  5      5      $ r…   ©
r  r•   r   r  r0   r/   r!  rX   r-  r.  r#  s     r   r0  ÚSymFloat.__floordiv__˜  sD   € Ü˜%¤(§,¡,´·±ÄÌÐ!Q×RÑRÜ!Ð!ÜœŸš D¬9°UÓ+;Ñ$;Ó<Ó=Ð=r   c                 óÖ   • [        U[        R                  [        R                  [        [
        45      (       d  [        $ [        [        R                  " [        U5      U -  5      5      $ r…   r±  r#  s     r   r4  ÚSymFloat.__rfloordiv__�  sD   € Ü˜%¤(§,¡,´·±ÄÌÐ!Q×RÑRÜ!Ð!ÜœŸš¤I¨eÓ$4°tÑ$;Ó<Ó=Ð=r   c                 ó6   • U R                   R                  5       $ r…   ©r  Úbool_r  s    r   r  ÚSymFloat.__bool__¢  ó   € Ø�y‰y�‰Ó Ð r   c                 ó:   • U R                   R                  SS5      $ )Nro   r   )r  Úguard_floatr  s    r   Ú	__float__ÚSymFloat.__float__¥  s   € Ø�y‰y×$Ñ$ R¨Ó+Ð+r   c                 ó>   • U R                  5       R                  5       $ r…   )Ú	__trunc__r  r  s    r   r  ÚSymFloat.__int__¨  s   € Ø�~‰~Ó×'Ñ'Ó)Ð)r   c                 óÔ   • [        U[        R                  [        R                  [        [
        45      (       d  [        $ [        R                  " U S:¬  5        U R                  U5      $ r	  )
r  r•   r   r  r0   r/   r!  ÚtorchÚ_checkÚ__float_pow__r#  s     r   r7  ÚSymFloat.__pow__­  sG   € Ü˜%¤(§,¡,´·±ÄÌÐ!Q×RÑRÜ!Ð!Ü�Š�T˜Q‘YÔØ×!Ñ! %Ó(Ð(r   c                 óÔ   • [        U[        R                  [        R                  [        [
        45      (       d  [        $ [        R                  " US:¬  5        U R                  U5      $ r	  )
r  r•   r   r  r0   r/   r!  rÂ  rÃ  Ú__rfloat_pow__r#  s     r   r;  ÚSymFloat.__rpow__³  sG   € Ü˜%¤(§,¡,´·±ÄÌÐ!Q×RÑRÜ!Ð!Ü�Š�U˜a‘ZÔ Ø×"Ñ" 5Ó)Ð)r   r$  r   c                 ó   • [        S5      er?  rA  r#  s     r   rC  ÚSymFloat.__eq__»  rE  r   c                 ó   • [        S5      er?  rA  r#  s     r   rG  ÚSymFloat.__lt__¾  rE  r   c                 ó   • [        S5      er?  rA  r#  s     r   rJ  ÚSymFloat.__gt__Á  rE  r   c                 ó   • [        S5      er?  rA  r#  s     r   rM  ÚSymFloat.__le__Ä  rE  r   c                 ó   • [        S5      er?  rA  r#  s     r   rP  ÚSymFloat.__ge__Ç  rE  r   c                 ó   • [        S5      er?  rA  r#  s     r   rÄ  ÚSymFloat.__float_pow__Ê  rE  r   c                 ó   • [        S5      er?  rA  r#  s     r   rÇ  ÚSymFloat.__rfloat_pow__Í  rE  r   c                 ó   • [        S5      er?  rA  r#  s     r   r  ÚSymFloat.__float_truediv__Ð  rE  r   c                 ó   • [        S5      er?  rA  r#  s     r   r(  ÚSymFloat.__rfloat_truediv__Ó  rE  r   c                 ó   • [        S5      er?  rA  r  s    r   r¿  ÚSymFloat.__trunc__Ö  rE  r   c                 ó   • [        S5      er?  rA  r#  s     r   rn  ÚSymFloat.__sym_max__Ù  rE  r   c                 ó   • [        S5      er?  rA  r#  s     r   rq  ÚSymFloat.__sym_min__Ü  rE  r   c                 ó   • [        S5      er?  rA  r  s    r   Ú__sym_int__ÚSymFloat.__sym_int__ß  rE  r   c                 ó   • [        S5      e)z'Return True if the float is an integer.r@  rA  r  s    r   Ú
is_integerÚSymFloat.is_integerâ  s   € äÐ2Ó3Ð3r   c                 óJ   • [         R                  " U 5      R                  5       $ )z.Represent this float as an exact integer ratio)r•   r  r˜  r  s    r   r˜  ÚSymFloat.as_integer_ratioæ  s   € ä�~Š~˜dÓ#×4Ñ4Ó6Ð6r   c                 ó6   • U R                   R                  5       $ r…   r†  r  s    r   rˆ  ÚSymFloat.__repr__ê  rŠ  r   c                 ó.   • U R                   R                  $ r…   rŒ  r  s    r   rŽ  ÚSymFloat._sympy_í  r�  r   c                 ó@   • [        [        R                  " U 5      5      $ r…   )r“  r•   r  r  s    r   r•  ÚSymFloat.__hash__ð  s   € Ü”H—N’N 4Ó(Ó)Ð)r   c                 ó   • U $ )z+Returns the complex conjugate of the float.r   r  s    r   rž  ÚSymFloat.conjugateó  s   € àˆr   c                 óV   • U R                   R                  SS5      R                  5       $ )z4Returns the hexadecimal representation of the float.ro   r   )r  r»  Úhexr  s    r   rò  ÚSymFloat.hex÷  s"   € à�y‰y×$Ñ$ R¨Ó+×/Ñ/Ó1Ð1r   r  Nr   )*r¡  r¢  r£  r¤  r¥  r  r%  r*  r0  r4  r  r¼  r  r7  r;  r¦  r•   r
  rC  rG  rJ  rM  rP  rÄ  rÇ  r  r(  r¿  rn  rq  râ  rå  r§  r   r˜  rˆ  rŽ  r•  rž  Ústrrò  r¨  r   r   r   r/   r/   ‚  sû   † ñòò
8ò
9ò
>ò
>ò
!ò,ò*ò
)ò*ð4˜Fð 4 x§}¡}ô 4ð4˜xŸ}™}ô 4ð4˜xŸ}™}ô 4ð4˜xŸ}™}ô 4ð4˜xŸ}™}ô 4ô4ô4ô4ô4ò4ò4ò4ò4ò4ð7 %¨¯©°h·l±lÐ(BÑ"Cô 7ò'òò*ôð2�S÷ 2r   r/   c                   óˆ   • \ rS rSrSrS rS rS rSS jrSS jr	SS	 jr
S
 rS\R                  4S jrS rS rS rS rSrg)r.   iü  aU  
Like a bool (including magic methods), but redirects all operations on the
wrapped node. This is used in particular to symbolically record operations
in the symbolic shape workflow.

Unlike regular bools, regular boolean operators will force extra guards instead
of symbolically evaluate.  Use the bitwise operators instead to handle this.
c                 ó   • Xl         g r…   r  r  s     r   r  ÚSymBool.__init__  r  r   c                 ó6   • U R                   R                  5       $ r…   r¶  r  s    r   r  ÚSymBool.__bool__  r¹  r   c                 ó^   • [         R                  " U R                  R                  5       5      $ r…   )r•   r   r  r·  r  s    r   r  ÚSymBool.__int__  s   € Ü�|Š|˜DŸI™IŸO™OÓ-Ó.Ð.r   r   c                 ó   • [        S5      er?  rA  r#  s     r   r€  ÚSymBool.__and__  rE  r   c                 ó   • [        S5      er?  rA  r#  s     r   rƒ  ÚSymBool.__or__  rE  r   c                 ó   • [        S5      er?  rA  r  s    r   Ú__sym_not__ÚSymBool.__sym_not__)  rE  r   c                 ó   • [        S5      er?  rA  )r  Úthen_valÚelse_vals      r   Ú__sym_ite__ÚSymBool.__sym_ite__,  rE  r   c                 ó   • [        S5      er?  rA  r#  s     r   rC  ÚSymBool.__eq__/  rE  r   c                 ó6   • U R                   R                  5       $ r…   r†  r  s    r   rˆ  ÚSymBool.__repr__2  rŠ  r   c                 ó.   • U R                   R                  $ r…   rŒ  r  s    r   rŽ  ÚSymBool._sympy_5  r�  r   c                 óÄ   • U R                   R                  5       (       a#  [        U R                   R                  5       5      $ [        [        R
                  " U 5      5      $ r…   )r  Úis_constantr“  r·  r•   r
  r  s    r   r•  ÚSymBool.__hash__8  sA   € Ø�9‰9× Ñ ×"Ñ"Ü˜Ÿ	™	Ÿ™Ó)Ó*Ð*ô œŸš dÓ+Ó,Ð,r   c                 óN   • SSK Jn  U" U R                  R                  5       5      $ )z~
Provides a SymFloat representation (0.0 or 1.0) for this SymBool.
Called by torch.sym_float() when casting SymBool to float.
r   )Ú	wrap_node)Útorch.fx.experimental.sym_noder  r  rX   )r  r  s     r   rt  ÚSymBool.__sym_float__?  s   € õ
 	=á˜Ÿ™×,Ñ,Ó.Ó/Ð/r   r  N)r   r.   )r¡  r¢  r£  r¤  r¥  r  r  r  r€  rƒ  r  r  r•   r
  rC  rˆ  rŽ  r•  rt  r¨  r   r   r   r.   r.   ü  sN   † ñòò
!ò/ô4ô4ô(4ò4ð4˜xŸ}™}ô 4ò'òò-õ0r   r.   c                 ó  • SSK n[        R                  " U 5      (       a  [        R                  " [        U 4U 5      $ [        U S5      (       a  U R                  5       $ [        XR                  5      (       a  U ) $ U (       + $ )z\SymInt-aware utility for logical negation.

Args:
    a (SymBool or bool): Object to negate
r   Nr  )	ÚsympyÚ	overridesÚhas_torch_function_unaryÚhandle_torch_functionr^   rœ   r  r  ÚBasic)Úar  s     r   r^   r^   I  se   € ó ä×)Ò)¨!×,Ñ,Ü×.Ò.¬w¸¸¸aÓ@Ð@Üˆq�-× Ñ Ø�}‰}‹ÐÜ�!—[‘[×!Ñ!Øˆrˆ	ØŒ5€Lr   c                 ó  • [         R                  " U 5      (       a  [         R                  " [        U 4U 5      $ [	        U [
        5      (       a  U $ [        U S5      (       a  U R                  5       $ [        R                  " U 5      $ )zcSymInt-aware utility for float casting.

Args:
    a (SymInt, SymFloat, or object): Object to cast
rt  )
r  r  r  rX   r  r/   rœ   rt  r•   r  ©r  s    r   rX   rX   Z  sg   € ô ×)Ò)¨!×,Ñ,Ü×.Ò.¬y¸1¸$ÀÓBÐBÜ�!”X×ÑØˆÜ	��O×	$Ñ	$Ø�‰Ó Ð Ü�>Š>˜!ÓÐr   c                 ó"  • [         R                  " U 5      (       a  [         R                  " [        U 4U 5      $ [	        U [
        5      (       a  U $ [	        U [        5      (       a  [        R                  " U 5      $ [        R                  " U 5      $ )zaSymInt-aware utility for int casting.

Args:
    a (SymInt, SymFloat, or object): Object to cast
)r  r  r  rZ   r  r0   r/   r-  Útruncr•   r   r  s    r   rZ   rZ   i  sg   € ô ×)Ò)¨!×,Ñ,Ü×.Ò.¬w¸¸¸aÓ@Ð@Ü�!”V×ÑØˆÜ	�A”x×	 Ñ	 Ü�zŠz˜!‹}ÐÜ�<Š<˜‹?Ðr   c                 ó¤  • [         R                  " X45      (       a  [         R                  " [        X4X5      $ [	        U [
        [        45      (       a  U R                  U5      $ [	        U[
        [        45      (       a  UR                  U 5      $ [        5       u  p#[	        X5      (       d  [        SU S[        U 5       35      e[	        X5      (       d  [        SU S[        U5       35      e[	        X5      (       d  [	        X5      (       a*  [        R                  " [        R                  " X5      5      $ [        R                  " X5      $ )a  
SymInt-aware utility for max which avoids branching on a < b.
Unlike builtins.max(), this only works for int/float, and it always
promotes to float if any argument is float (unlike builtins.max, which
will faithfully preserve the type of the input argument).
ú	expected ú, got )r  Úhas_torch_functionr  r\   r  r0   r/   rn  Ú__all_and_float_typesrÕ   Útyper•   r  Úmax©r  ÚbÚ	all_typesÚfloat_typess       r   r\   r\   x  s	  € ô ×#Ò# Q F×+Ñ+Ü×.Ò.¬w¸¸ÀÓEÐEÜ�!”fœhÐ'×(Ñ(Ø�}‰}˜QÓÐÜ	�Aœ¤Ð)×	*Ñ	*ð �}‰}˜QÓÐô 3Ó4Ñ€Iä�a×#Ñ#Ü˜y¨¨°6¼$¸q»'¸ÐCÓDÐDÜ�a×#Ñ#Ü˜y¨¨°6¼$¸q»'¸ÐCÓDÐDÜ�!×!Ñ!¤Z°×%?Ñ%?Ü�~Š~œhŸlšl¨1Ó0Ó1Ð1ä�|Š|˜AÓ!Ð!r   .c                  ó<  •  SS K n U R                  U R                  [        R                  [        R
                  4nU R                  [        R
                  4nX4$ ! [         a6    [        R                  [        R
                  4n[        R
                  4n X4$ f = fr	  )ÚnumpyÚintegerÚfloatingr•   r   r  ÚModuleNotFoundError)Únpr)  r*  s      r   r$  r$  •  s†   € ð(Ûð �J‰JØ�K‰KÜ�L‰LÜ�N‰Nð	'
ˆ	ð *,¯©´h·n±nÐ(Eˆð
 Ð!Ð!øô	 ó (Ü—\‘\¤8§>¡>Ð2ˆ	Ü—~‘~Ð'‰àÐ!Ð!ð	(ús   ‚AA Á;BÂBc                 ó¤  • [         R                  " X45      (       a  [         R                  " [        X4X5      $ [	        U [
        [        45      (       a  U R                  U5      $ [	        U[
        [        45      (       a  UR                  U 5      $ [        5       u  p#[	        X5      (       d  [        SU S[        U 5       35      e[	        X5      (       d  [        SU S[        U5       35      e[	        X5      (       d  [	        X5      (       a*  [        R                  " [        R                  " X5      5      $ [        R                  " X5      $ )zSymInt-aware utility for min().r!  r"  )r  r#  r  r]   r  r0   r/   rq  r$  rÕ   r%  r•   r  Úminr'  s       r   r]   r]   §  s  € ä×#Ò# Q F×+Ñ+Ü×.Ò.¬w¸¸ÀÓEÐEÜ�!”fœhÐ'×(Ñ(Ø�}‰}˜QÓÐÜ	�Aœ¤Ð)×	*Ñ	*Ø�}‰}˜QÓÐä2Ó4Ñ€Iä�a×#Ñ#Ü˜y¨¨°6¼$¸q»'¸ÐCÓDÐDÜ�a×#Ñ#Ü˜y¨¨°6¼$¸q»'¸ÐCÓDÐDÜ�!×!Ñ!¤Z°×%?Ñ%?Ü�~Š~œhŸlšl¨1Ó0Ó1Ð1ä�|Š|˜AÓ!Ð!r   c                 óà  ^^• [         R                  " U 5      (       a  [         R                  " [        X 5      $ SmU  Hc  n[	        U[
        [        R                  45      (       d  [        R                  " U 5      s  $ [	        U[
        5      (       d  MW  UR                  mMe     Tc  [        R                  " U 5      $ SSK
JmJn  U" TR                  [        UU4S jU  5       5      5      5      $ )z
N-ary add which is faster to compute for long lists than iterated binary
addition.  Only does something special for integers.
Nr   )Úto_noder  c              3   ó6   >#   • U  H  nT" TU5      v •  M     g 7fr…   r   )rv   r  Úfoundr4  s     €€r   rx   Úsym_sum.<locals>.<genexpr>Ï  s   øé € Ð(IÂD¸q©°¸×):Ð):ÂDùs   ƒ)r  r#  r  r_   r  r0   r•   r   Úsumr  r  r4  r  r§  )rê   r  r  r6  r4  s      @@r   r_   r_   ¼  s«   ù€ ô
 ×#Ò# D×)Ñ)Ü×.Ò.¬w¸ÓCÐCà€EÛˆÜ˜!œf¤h§l¡lÐ3×4Ñ4Ü—<’< Ó%Ò%Ü�aœ× Ó Ø—F‘FŠEñ	 ð
 �}Ü�|Š|˜DÓ!Ð!çAá�U—]‘]¤5Õ(IÁDÓ(IÓ#IÓJÓKÐKr   c                 ó   ^ ^• UU 4S jmT$ )Nc                 óB  >• [         R                  " U 5      (       a  [         R                  " TU 4U 5      $ [        U [        5      (       a  [
        R                  " U 5      n [        U ST S35      (       a  [        U ST S35      " 5       $ [        [        T5      " U 5      $ )NÚ__sym_Ú__)
r  r  r  r  r0   rÂ  rX   rœ   Úgetattrr-  )r  ÚfnÚnames    €€r   r>  Ú_get_sym_math_fn.<locals>.fnÔ  s‡   ø€ Ü×-Ò-¨a×0Ñ0Ü×2Ò2°2¸°t¸QÓ?Ð?Ü�aœ× Ñ Ü—’ Ó"ˆAÜ�1˜˜t˜f BÐ'×(Ñ(Ü˜1  t f¨BÐ/Ô0Ó2Ð2Ü”t˜TÔ" 1Ó%Ð%r   r   )r?  r>  s   `@r   Ú_get_sym_math_fnrA  Ó  s   ù€ ö&ð €Ir   )Nro   ro   )ÚsqrtÚcosÚcoshÚsinÚsinhÚtanÚtanhÚasinÚacosÚatanÚlog2Ú_sym_Ú	_sym_sqrtÚsym_sqrtc                 óÈ  • [         R                  " XU45      (       a  [         R                  " [        XU4XU5      $ [	        U [
        [        R                  45      (       d  [        S[        U 5       35      e[        U5      [        U5      La#  [        S[        U5       S[        U5       35      e[	        U [
        5      (       a  U R                  X5      $ U (       a  U$ U$ )z>SymInt-aware utility for ternary operator (``t if b else f``.)zexpected SymBool or bool, got ztype mismatch: z vs )r  r#  r  r[   r  r.   r•   r
  rÕ   r%  r  )r(  Útrú   s      r   r[   r[   û  s¸   € ä×#Ò# Q¨1 I×.Ñ.Ü×.Ò.¬w¸¸q¸	À1ÈÓKÐKÜ�aœ'¤8§=¡=Ð1×2Ñ2ÜÐ=¼dÀ1»g¸YÐGÓHÐHÜˆAƒw”d˜1“gÒÜ˜¬t°A«w¨i°t¼DÀ»G¸9ÐEÓFÐFÜ�!”W×ÑØ�}‰}˜QÓ"Ð"Þˆ1Ð�qÐr   c                 óJ   • [         R                  " U 5      R                  5       $ r…   )rÂ  ÚtensorÚitem)r�  s    r   rY   rY   	  s   € Ü�<Š<˜Ó×"Ñ"Ó$Ð$r   )Ú_initExtensionaí  
                Failed to load PyTorch C extensions:
                    It appears that PyTorch has loaded the `torch/_C` folder
                    of the PyTorch repository rather than the C extensions which
                    are expected in the `torch._C` namespace. This can occur when
                    using the `install` workflow. e.g.
                        $ python -m pip install --no-build-isolation -v . && python -c "import torch"

                    This error can generally be solved using the `develop` workflow
                        $ python -m pip install --no-build-isolation -v -e . && python -c "import torch"  # This should succeed
                    or by running Python from a different directory.
                )Ú_C)ro   Nr€   ÚBase>   Ú	GeneratorÚDisableTorchFunctionÚDisableTorchFunctionSubclassÚ
TensorBasec                 óv  • Uc
  [        5       nX;   a  g UR                  U 5        U R                  n[        U 5       Hz  n[	        X5      n[	        USS5      n[
        R                  " U5      (       d  M8  UR                  U5      (       d  MP  [        R                  R                  XT5        [        XA5        M|     g )Nr¡  ro   )ÚsetÚaddr¡  Údirr=  ÚinspectÚismoduleÚ
startswithr�   ÚmodulesÚ
setdefaultÚ _import_extension_to_sys_modules)ÚmoduleÚmemoÚmodule_namer?  ÚmemberÚmember_names         r   re  re  F  sŒ   € Ø‰<Ü“5ˆDØ‹>ØØ�‰�ÔØ—o‘oˆÜ˜–KˆDÜ˜VÓ*ˆFÜ! &¨*°bÓ9ˆKÜ×Ò ×'Ó'¨K×,BÑ,BÀ;×,OÓ,OÜ—‘×&Ñ& {Ô;ä0°Ö>ò  r   Úobjc                ó�  • [        U [        R                  5      (       a  U R                  5       $ [	        U SS5      =(       d    SnSn[        U S5      (       a  U R                  nOS[        U S5      (       a  U R                  nO5U R                  R                  =(       d    SnU R                  R                  nUS;   a  U$ U SU 3$ )a™  
String representation of the type of an object.

This function returns a fully qualified string representation of an object's type.
Args:
    obj (object): The object whose type to represent
Returns:
    str: the type of the object `o`
Example:
    >>> x = torch.tensor([1, 2, 3])
    >>> torch.typename(x)
    'torch.LongTensor'
    >>> torch.typename(torch.nn.Parameter)
    'torch.nn.parameter.Parameter'
r¢  ro   r£  r¡  >   ro   r•   r   )
r  rÂ  r1   r%  r=  rœ   r£  r¡  Ú	__class__r¢  )rk  rf  Úqualnames      r   r`   r`   ]  s©   € ô  �#”u—|‘|×$Ñ$Ø�x‰x‹zÐä�S˜,¨Ó+×1¨r€FØ€Häˆs�N×#Ñ#Ø×#Ñ#‰Ü	��j×	!Ñ	!Ø—<‘<‰à—‘×)Ñ)×/¨RˆØ—=‘=×-Ñ-ˆàÐ!Ó!ØˆØˆX�Q�x�jÐ!Ð!r   ztorch.Tensorc                ó6   • [        U [        R                  5      $ )z§Returns True if `obj` is a PyTorch tensor.

Args:
    obj (object): Object to test
Example::

    >>> x = torch.tensor([1, 2, 3])
    >>> torch.is_tensor(x)
    True

)r  rÂ  r1   ©rk  s    r   rD   rD   €  s   € ô �cœ5Ÿ<™<Ó(Ð(r   c                ó&   • [        U 5      [        ;   $ )ar  Returns True if `obj` is a PyTorch storage object.

Args:
    obj (Object): Object to test
Example::

    >>> import torch
    >>> # UntypedStorage (recommended)
    >>> tensor = torch.tensor([1, 2, 3])
    >>> storage = tensor.untyped_storage()
    >>> torch.is_storage(storage)
    True
    >>>
    >>> # TypedStorage (legacy)
    >>> typed_storage = torch.TypedStorage(5, dtype=torch.float32)
    >>> torch.is_storage(typed_storage)
    True
    >>>
    >>> # regular tensor (should return False)
    >>> torch.is_storage(tensor)
    False
    >>>
    >>> # non-storage object
    >>> torch.is_storage([1, 2, 3])
    False
)r%  Ú_storage_classesrp  s    r   rC   rC   �  s   € ô6 �‹9Ô(Ñ(Ð(r   c            	      ó   ^• SSK Jn   SSKJm  S n[	        [        U4S j[        U " 5       5      5      S5      nU(       a  UR                  nU" U5      $ [        [        SS5      nUb  U" UR                  5      $ [        R                  " S5      $ )	z?Gets the default ``torch.Tensor`` to be allocated on ``device``r   )Ú _get_current_function_mode_stack©ÚDeviceContextc                 ó`   • U R                   b  U $ [        R                  " / 5      R                  $ r…   )ÚindexrÂ  rS  Údevice)ry  s    r   Ú_get_device_with_indexÚ2get_default_device.<locals>._get_device_with_index·  s(   € Ø�<‰<Ñ#ØˆMô —<’< Ó#×*Ñ*Ð*r   c                 ó   >• [        U T5      $ r…   )r  )rñ   rv  s    €r   Ú<lambda>Ú$get_default_device.<locals>.<lambda>Â  s   ø€ œ D¨-Ô8r   NÚdevice_contextÚcpu)Útorch.overridesrt  Útorch.utils._devicerv  ÚnextÚfilterÚreversedry  r=  Ú_GLOBAL_DEVICE_CONTEXTrÂ  )rt  rz  Údevice_modery  r  rv  s        @r   r;   r;   °  sŠ   ø€ õ AÝ1ò+ô ÜÜ8ÜÑ5Ó7Ó8ó	
ð 	ó€Kö Ø×#Ñ#ˆÙ% fÓ-Ð-äÔ3Ð5EÀtÓL€NØÑ!Ù% n×&;Ñ&;Ó<Ð<Ü�<Š<˜ÓÐr   ry  c                 óØ   • [        [        S5      (       a&  [        R                  nUb  UR                  SSS5        U c  SnOSSKJn  U" U 5      nUR                  5         U[        l        g)a�  Sets the default ``torch.Tensor`` to be allocated on ``device``.  This
does not affect factory function calls which are called with an explicit
``device`` argument.  Factory calls will be performed as if they
were passed ``device`` as an argument.

To only temporarily change the default device instead of setting it
globally, use ``with torch.device(device):`` instead.

The default device is initially ``cpu``.  If you set the default tensor
device to another device (e.g., ``cuda``) without a device index, tensors
will be allocated on whatever the current device for the device type,
even after :func:`torch.cuda.set_device` is called.

.. warning::

    This function imposes a slight performance cost on every Python
    call to the torch API (not just factory functions).  If this
    is causing problems for you, please comment on
    https://github.com/pytorch/pytorch/issues/92701

.. note::

    This doesn't affect functions that create tensors that share the same memory as the input, like:
    :func:`torch.from_numpy` and :func:`torch.frombuffer`

Args:
    device (device or string): the device to set as default

Example::

    >>> # xdoctest: +SKIP("requires cuda, changes global state")
    >>> torch.get_default_device()
    device(type='cpu')
    >>> torch.set_default_device('cuda')  # current device is 0
    >>> torch.get_default_device()
    device(type='cuda', index=0)
    >>> torch.set_default_device('cuda')
    >>> torch.cuda.set_device('cuda:1')  # current device is 1
    >>> torch.get_default_device()
    device(type='cuda', index=1)
    >>> torch.set_default_device('cuda:1')
    >>> torch.get_default_device()
    device(type='cuda', index=1)

r  Nr   ru  )rœ   r†  r  Ú__exit__r‚  rv  Ú	__enter__)ry  r  rv  s      r   rO   rO   Ñ  sc   € ô^ Ô%Ð'7×8Ñ8Ü/×>Ñ>ˆØÑ%Ø×#Ñ# D¨$°Ô5à�~Ø‰å5á& vÓ.ˆØ× Ñ Ô"Ø,:ÔÕ)r   rQ  c                óp   • [        U [        5      (       a  [        U 5      n [        R                  " U 5        g)aa  
.. warning::

    This function is deprecated as of PyTorch 2.1, please use :func:`torch.set_default_dtype()` and
    :func:`torch.set_default_device()` as alternatives.

Sets the default ``torch.Tensor`` type to floating point tensor type
``t``. This type will also be used as default floating point type for
type inference in :func:`torch.tensor`.

The default floating point tensor type is initially ``torch.FloatTensor``.

Args:
    t (type or string): the floating point tensor type or its name

Example::

    >>> # xdoctest: +SKIP("Other tests may have changed the default type. Can we reset it?")
    >>> torch.tensor([1.2, 3]).dtype    # initial default for floating point is torch.float32
    torch.float32
    >>> torch.set_default_tensor_type(torch.DoubleTensor)
    >>> torch.tensor([1.2, 3]).dtype    # a new floating point tensor
    torch.float64

N)r  rô  r   rV  Ú_set_default_tensor_type)rQ  s    r   rP   rP     s)   € ô4 �!”S×ÑÜ Ó"ˆÜ×Ò Õ"r   c                ó0   • [         R                  " U 5        g)ah  

Sets the default floating point dtype to :attr:`d`. Supports floating point dtype
as inputs. Other dtypes will cause torch to raise an exception.

When PyTorch is initialized its default floating point dtype is torch.float32,
and the intent of set_default_dtype(torch.float64) is to facilitate NumPy-like
type inference. The default floating point dtype is used to:

1. Implicitly determine the default complex dtype. When the default floating type is float16,
   the default complex dtype is complex32. For float32, the default complex dtype is complex64.
   For float64, it is complex128. For bfloat16, an exception will be raised because
   there is no corresponding complex type for bfloat16.
2. Infer the dtype for tensors constructed using Python floats or complex Python
   numbers. See examples below.
3. Determine the result of type promotion between bool and integer tensors and
   Python floats and complex Python numbers.

Args:
    d (:class:`torch.dtype`): the floating point dtype to make the default.

Example:
    >>> # xdoctest: +SKIP("Other tests may have changed the default type. Can we reset it?")
    >>> # initial default for floating point is torch.float32
    >>> # Python floats are interpreted as float32
    >>> torch.tensor([1.2, 3]).dtype
    torch.float32
    >>> # initial default for floating point is torch.complex64
    >>> # Complex Python numbers are interpreted as complex64
    >>> torch.tensor([1.2, 3j]).dtype
    torch.complex64

    >>> torch.set_default_dtype(torch.float64)
    >>> # Python floats are now interpreted as float64
    >>> torch.tensor([1.2, 3]).dtype  # a new floating point tensor
    torch.float64
    >>> # Complex Python numbers are now interpreted as complex128
    >>> torch.tensor([1.2, 3j]).dtype  # a new complex tensor
    torch.complex128

    >>> torch.set_default_dtype(torch.float16)
    >>> # Python floats are now interpreted as float16
    >>> torch.tensor([1.2, 3]).dtype  # a new floating point tensor
    torch.float16
    >>> # Complex Python numbers are now interpreted as complex128
    >>> torch.tensor([1.2, 3j]).dtype  # a new complex tensor
    torch.complex32

N)rV  Ú_set_default_dtype)Úds    r   Úset_default_dtyper�  .  s   € ôd ×Ò˜!Õr   F©Ú	warn_onlyrñ   r’  c                óJ   • SSK Js  Jn  Xl        [        R
                  " XS9  g)a¼  Sets whether PyTorch operations must use "deterministic"
algorithms. That is, algorithms which, given the same input, and when
run on the same software and hardware, always produce the same output.
When enabled, operations will use deterministic algorithms when available,
and if only nondeterministic algorithms are available they will throw a
:class:`RuntimeError` when called.

.. note:: This setting alone is not always enough to make an application
    reproducible. Refer to :ref:`reproducibility` for more information.

.. note:: :func:`torch.set_deterministic_debug_mode` offers an alternative
    interface for this feature.

The following normally-nondeterministic operations will act
deterministically when ``mode=True``:

    * :class:`torch.nn.Conv1d` when called on CUDA tensor
    * :class:`torch.nn.Conv2d` when called on CUDA tensor
    * :class:`torch.nn.Conv3d` when called on CUDA tensor
    * :class:`torch.nn.ConvTranspose1d` when called on CUDA tensor
    * :class:`torch.nn.ConvTranspose2d` when called on CUDA tensor
    * :class:`torch.nn.ConvTranspose3d` when called on CUDA tensor
    * :class:`torch.nn.ReplicationPad1d` when attempting to differentiate a CUDA tensor
    * :class:`torch.nn.ReplicationPad2d` when attempting to differentiate a CUDA tensor
    * :class:`torch.nn.ReplicationPad3d` when attempting to differentiate a CUDA tensor
    * :func:`torch.bmm` when called on sparse-dense CUDA tensors
    * :func:`torch.Tensor.__getitem__` when attempting to differentiate a CPU tensor
      and the index is a list of tensors
    * :func:`torch.Tensor.index_put` with ``accumulate=False``
    * :func:`torch.Tensor.index_put` with ``accumulate=True`` when called on a CPU
      tensor
    * :func:`torch.Tensor.put_` with ``accumulate=True`` when called on a CPU
      tensor
    * :func:`torch.Tensor.scatter_add_` when called on a CUDA tensor
    * :func:`torch.gather` when called on a CUDA tensor that requires grad
    * :func:`torch.index_add` when called on CUDA tensor
    * :func:`torch.index_select` when attempting to differentiate a CUDA tensor
    * :func:`torch.repeat_interleave` when attempting to differentiate a CUDA tensor
    * :func:`torch.Tensor.index_copy` when called on a CPU or CUDA tensor
    * :func:`torch.Tensor.scatter` when `src` type is Tensor and called on CUDA tensor
    * :func:`torch.Tensor.scatter_reduce` when ``reduce='sum'`` or ``reduce='mean'`` and called on CUDA tensor

The following normally-nondeterministic operations will throw a
:class:`RuntimeError` when ``mode=True``:

    * :class:`torch.nn.AvgPool3d` when attempting to differentiate a CUDA tensor
    * :class:`torch.nn.AdaptiveAvgPool2d` when attempting to differentiate a CUDA tensor
    * :class:`torch.nn.AdaptiveAvgPool3d` when attempting to differentiate a CUDA tensor
    * :class:`torch.nn.MaxPool3d` when attempting to differentiate a CUDA tensor
    * :class:`torch.nn.AdaptiveMaxPool2d` when attempting to differentiate a CUDA tensor
    * :class:`torch.nn.FractionalMaxPool2d` when attempting to differentiate a CUDA tensor
    * :class:`torch.nn.FractionalMaxPool3d` when attempting to differentiate a CUDA tensor
    * :class:`torch.nn.MaxUnpool1d`
    * :class:`torch.nn.MaxUnpool2d`
    * :class:`torch.nn.MaxUnpool3d`
    * :func:`torch.nn.functional.interpolate` when attempting to differentiate a CUDA tensor
      and one of the following modes is used:

      - ``linear``
      - ``bilinear``
      - ``bicubic``
      - ``trilinear``

    * :class:`torch.nn.ReflectionPad1d` when attempting to differentiate a CUDA tensor
    * :class:`torch.nn.ReflectionPad2d` when attempting to differentiate a CUDA tensor
    * :class:`torch.nn.ReflectionPad3d` when attempting to differentiate a CUDA tensor
    * :class:`torch.nn.NLLLoss` when called on a CUDA tensor
    * :class:`torch.nn.CTCLoss` when attempting to differentiate a CUDA tensor
    * :class:`torch.nn.EmbeddingBag` when attempting to differentiate a CUDA tensor when
      ``mode='max'``
    * :func:`torch.Tensor.put_` when ``accumulate=False``
    * :func:`torch.Tensor.put_` when ``accumulate=True`` and called on a CUDA tensor
    * :func:`torch.histc` when called on a CUDA tensor
    * :func:`torch.bincount` when called on a CUDA tensor and ``weights``
      tensor is given
    * :func:`torch.median` with indices output when called on a CUDA tensor
    * :func:`torch.nn.functional.grid_sample` when attempting to differentiate a CUDA tensor
    * :func:`torch.cumsum` when called on a CUDA tensor when dtype is floating point or complex
    * :func:`torch.Tensor.scatter_reduce` when ``reduce='prod'`` and called on CUDA tensor
    * :func:`torch.Tensor.resize_` when called with a quantized tensor

In addition, several operations fill uninitialized memory when this setting
is turned on and when
:attr:`torch.utils.deterministic.fill_uninitialized_memory` is turned on.
See the documentation for that attribute for more information.

Note that deterministic operations tend to have worse performance than
nondeterministic operations.


When this setting is turned on, the Inductor deterministic mode is also tuned on
automatically. In deterministic mode, Inductor would avoid doing on device benchmarking
that affect numerics. This includes:

  - don't pad matmul input shapes. Without enabling deterministic mode, Inductor would do
    benchmarking to check if padding matmul shape is beneficial.
  - don't autotune templates. Inductor has templates for kernels like matmul/conv/attention.
    Without enabling deterministic mode, Inductor would do autotuning to
    pick the best configs for those templates and adopt it if it's faster
    than the kernel in eager mode. In deterministic mode, we pick the eager kernel.
  - don't autotune triton configs for reduction. Reduction numerics are
    very sensitive to triton configs. In deterministic mode, Inductor
    will use some heuristics to pick the most promising configs rather
    than do autotuning.
  - Skip autotuning for reduction in coordinate descent tuning.
  - Don't benchmarking for the computation/communication reordering pass
  - Disable the feature that dynamically scale down RBLOCK triton config for higher
    occupancy.


.. note::

    This flag does not detect or prevent nondeterministic behavior caused
    by calling an inplace operation on a tensor with an internal memory
    overlap or by giving such a tensor as the :attr:`out` argument for an
    operation. In these cases, multiple writes of different data may target
    a single memory location, and the order of writes is not guaranteed.

Args:
    mode (:class:`bool`): If True, makes potentially nondeterministic
        operations switch to a deterministic algorithm or throw a runtime
        error. If False, allows nondeterministic operations.

Keyword args:
    warn_only (:class:`bool`, optional): If True, operations that do not
        have a deterministic implementation will throw a warning instead of
        an error. Default: ``False``

Example::

    >>> # xdoctest: +SKIP
    >>> torch.use_deterministic_algorithms(True)

    # Backward mode nondeterministic error
    >>> torch.nn.AvgPool3d(1)(torch.randn(3, 4, 5, 6, requires_grad=True).cuda()).sum().backward()
    ...
    RuntimeError: avg_pool3d_backward_cuda does not have a deterministic implementation...
r   Nr‘  )Útorch._inductor.configÚ	_inductorÚconfigÚdeterministicrV  Ú_set_deterministic_algorithms)rñ   r’  Úinductor_configs      r   rb   rb   c  s   € ÷^ 5Ð4à$(Ô!Ü×$Ò$ TÓ?r   c                  ó,   • [         R                  " 5       $ )z�Returns True if the global deterministic flag is turned on. Refer to
:func:`torch.use_deterministic_algorithms` documentation for more details.
)rV  Ú_get_deterministic_algorithmsr   r   r   r4   r4   ø  ó   € ô ×+Ò+Ó-Ð-r   c                  ó,   • [         R                  " 5       $ )z—Returns True if the global deterministic flag is set to warn only.
Refer to :func:`torch.use_deterministic_algorithms` documentation for more
details.
)rV  Ú'_get_deterministic_algorithms_warn_onlyr   r   r   rB   rB   ÿ  s   € ô
 ×5Ò5Ó7Ð7r   Ú
debug_modec                 ó¾  • [        U [        R                  [        45      (       d  [	        S[        U 5       35      e[        U [        5      (       a)  U S:X  a  Sn O U S:X  a  Sn OU S:X  a  Sn O[        SU  35      eU S:X  a  [        R                  " S	5        gU S:X  a  [        R                  " S
S
S9  gU S:X  a  [        R                  " S
5        g[        SU  35      e)aÒ  Sets the debug mode for deterministic operations.

.. note:: This is an alternative interface for
    :func:`torch.use_deterministic_algorithms`. Refer to that function's
    documentation for details about affected operations.

Args:
    debug_mode(str or int): If "default" or 0, don't error or warn on
        nondeterministic operations. If "warn" or 1, warn on
        nondeterministic operations. If "error" or 2, error on
        nondeterministic operations.
z'debug_mode must be str or int, but got Údefaultr   Úwarnrd   Úerroré   zQinvalid value of debug_mode, expected one of `default`, `warn`, `error`, but got FTr‘  z:invalid value of debug_mode, expected 0, 1, or 2, but got N)	r  r•   r   rô  rB  r%  ÚRuntimeErrorrV  r˜  )rŸ  s    r   rQ   rQ     sÝ   € ô  �j¤8§<¡<´Ð"5×6Ñ6ÜÐAÄ$ÀzÓBRÐASÐTÓUÐUä�*œc×"Ñ"Ø˜Ó"Ø‰JØ˜6Ó!Ø‰JØ˜7Ó"Ø‰Jäð,Ø,6¨<ð9óð ð
 �QƒÜ
×(Ò(¨Õ/Ø	�q‹Ü
×(Ò(¨¸Ó>Ø	�q‹Ü
×(Ò(¨Õ.äØHÈÈÐUó
ð 	
r   c                  óp   • [         R                  " 5       (       a  [         R                  " 5       (       a  ggg)zžReturns the current value of the debug mode for deterministic
operations. Refer to :func:`torch.set_deterministic_debug_mode`
documentation for more details.
rd   r¤  r   )rV  r›  rž  r   r   r   r<   r<   3  s+   € ô 
×'Ò'×)Ñ)Ü×5Ò5×7Ñ7Øààr   c                  ó,   • [         R                  " 5       $ )zšReturns the current value of float32 matrix multiplication precision. Refer to
:func:`torch.set_float32_matmul_precision` documentation for more details.
)rV  Ú_get_float32_matmul_precisionr   r   r   r>   r>   B  rœ  r   Ú	precisionc                 ó0   • [         R                  " U 5        g)aÌ  Sets the internal precision of float32 matrix multiplications.

Running float32 matrix multiplications in lower precision may significantly increase
performance, and in some programs the loss of precision has a negligible impact.

Supports three settings:

    * "highest", float32 matrix multiplications use the float32 datatype (24 mantissa
      bits with 23 bits explicitly stored) for internal computations.
    * "high", float32 matrix multiplications either use the TensorFloat32 datatype (10
      mantissa bits explicitly stored) or treat each float32 number as the sum of two bfloat16 numbers
      (approximately 16 mantissa bits with 14 bits explicitly stored), if the appropriate fast matrix multiplication
      algorithms are available.  Otherwise float32 matrix multiplications are computed
      as if the precision is "highest".  See below for more information on the bfloat16
      approach.
    * "medium", float32 matrix multiplications use the bfloat16 datatype (8 mantissa
      bits with 7 bits explicitly stored) for internal computations, if a fast matrix multiplication algorithm
      using that datatype internally is available. Otherwise float32
      matrix multiplications are computed as if the precision is "high".

When using "high" precision, float32 multiplications may use a bfloat16-based algorithm
that is more complicated than simply truncating to some smaller number mantissa bits
(e.g. 10 for TensorFloat32, 7 for bfloat16 explicitly stored).  Refer to [Henry2019]_ for a complete
description of this algorithm.  To briefly explain here, the first step is to realize
that we can perfectly encode a single float32 number as the sum of three bfloat16
numbers (because float32 has 23 mantissa bits while bfloat16 has 7 explicitly stored, and both have the
same number of exponent bits).  This means that the product of two float32 numbers can
be exactly given by the sum of nine products of bfloat16 numbers.  We can then trade
accuracy for speed by dropping some of these products.  The "high" precision algorithm
specifically keeps only the three most significant products, which conveniently excludes
all of the products involving the last 8 mantissa bits of either input.  This means that
we can represent our inputs as the sum of two bfloat16 numbers rather than three.
Because bfloat16 fused-multiply-add (FMA) instructions are typically >10x faster than
float32 ones, it's faster to do three multiplications and 2 additions with bfloat16
precision than it is to do a single multiplication with float32 precision.

.. [Henry2019] http://arxiv.org/abs/1904.06376

.. note::

    This does not change the output dtype of float32 matrix multiplications,
    it controls how the internal computation of the matrix multiplication is performed.

.. note::

    This does not change the precision of convolution operations. Other flags,
    like `torch.backends.cudnn.allow_tf32`, may control the precision of convolution
    operations.

.. note::

    This flag currently only affects one native device type: CUDA.
    If "high" or "medium" are set then the TensorFloat32 datatype will be used
    when computing float32 matrix multiplications, equivalent to setting
    `torch.backends.cuda.matmul.allow_tf32 = True`. When "highest" (the default)
    is set then the float32 datatype is used for internal computations, equivalent
    to setting `torch.backends.cuda.matmul.allow_tf32 = False`.

Args:
    precision(str): can be set to "highest" (default), "high", or "medium" (see above).

N)rV  Ú_set_float32_matmul_precision)r©  s    r   rR   rR   I  s   € ô~ ×$Ò$ YÕ/r   r(  c                ó0   • [         R                  " U 5        g)ax  When this flag is False (default) then some PyTorch warnings may only
appear once per process. This helps avoid excessive warning information.
Setting it to True causes these warnings to always appear, which may be
helpful when debugging.

Args:
    b (:class:`bool`): If True, force warnings to always be emitted
                       If False, set to the default behaviour
N)rV  Ú_set_warnAlways)r(  s    r   rU   rU   ‹  s   € ô ×Ò�qÕr   c                  ó,   • [         R                  " 5       $ )z�Returns True if the global warn_always flag is turned on. Refer to
:func:`torch.set_warn_always` documentation for more details.
)rV  Ú_get_warnAlwaysr   r   r   rE   rE   ˜  s   € ô ×ÒÓÐr   r8   Úmessagec                 ó„  • [        U[        R                  [        45      (       d  [	        S[        U5       35      eSSKJn  U" U5      (       a  g [        U [        5      (       a  [        U [        5      (       a  [        SU  35      eUc  SnO+[        U5      (       d  [	        S5      e[        U" 5       5      nU " U5      e)Nzcond must be a bool, but got r   )Úexpect_truez@error_type must be a subclass of Exception but not Warning, got zˆExpected cond to be True, but got False. (Could this error message be improved? If so, please report an enhancement request to PyTorch.)zmessage must be a callable)r  r•   r
  r.   rB  r%  Ú%torch.fx.experimental.symbolic_shapesr²  Ú
issubclassrö   ÚWarningrÕ   Úcallablerô  )Ú
error_typer8   r°  r²  Úmessage_evaluateds        r   Ú_check_withr¹  §  s¶   € ô
 �dœXŸ]™]¬GÐ4×5Ñ5ÜÐ7¼¸T»
°|ÐDÓEÐEåAá�4×ÑØô �j¤)×,Ñ,´
¸:Äw×0OÑ0OÜØNÈzÈlÐ[ó
ð 	
ð �ðñ 	ô ˜× Ñ ÜÐ8Ó9Ð9ä¡£	›NÐá
Ð&Ó
'Ð'r   c                 ó$   • [        [        X5        g)a€  Throws error containing an optional message if the specified condition
is False.

Error type: ``RuntimeError``

C++ equivalent: ``TORCH_CHECK``

Args:
    cond (:class:`bool`): If False, throw error

    message (Callable, optional): Callable that returns either a string or
        an object that has a ``__str__()`` method to be used as the error
        message. Default: ``None``
N)r¹  r¥  ©r8   r°  s     r   rÃ  rÃ  Ê  s   € ô ”˜dÕ,r   z{_check_is_size will be removed in a future PyTorch release along with guard_size_oblivious.     Use _check(i >= 0) instead.)Úcategory)r&  c                ó~   • [        U S:¬  U5        SSKJn  U" U 5        Ub  [        X:*  U5        SSKJn  U" X5        gg)aG  Checks that a given integer is a valid size (i.e., is non-negative).
You should use this over ``_check(i >= 0)`` because it can prevent
``GuardOnDataDependentSymNode`` exceptions by opting yourself into alternate
semantics for ``guard_size_oblivious`` tests that treat values 0 and 1
equivalently to all other values.

When max is not None, this specifies an upper bound equivalent to
``_check(i <= max)``.  This bound is also subject to alternate semantics:
in ``guard_size_oblivious`` tests, we assume that a constant max bound is
treated equivalently to all other values.  Symbolic max bounds are not yet
supported.

NB: Do NOT use this in contexts where a -1 size would be valid (indicating
to infer the size from context, or if you should wrap-around or truncate).
Only use this if the only valid value is an honest to goodness size.
r   )Ú_advise_is_sizeN)Ú_advise_is_bounded)rÃ  r³  r¾  r¿  )Úir°  r&  r¾  r¿  s        r   Ú_check_is_sizerÁ  Ü  s>   € ô. ˆ1�‰6�7ÔÝEá�AÔà
�Üˆq‰x˜Ô!åLá˜1Õ"ð r   c                 ó$   • [        [        X5        g)a„  Throws error containing an optional message if the specified condition
is False.

Error type: ``IndexError``

C++ equivalent: ``TORCH_CHECK_INDEX``

Args:
    cond (:class:`bool`): If False, throw error

    message (Callable, optional): Callable that returns either a string or
        an object that has a ``__str__()`` method to be used as the error
        message. Default: ``None``
N)r¹  Ú
IndexErrorr»  s     r   Ú_check_indexrÄ     ó   € ô ”
˜DÕ*r   c                 ó$   • [        [        X5        g)a„  Throws error containing an optional message if the specified condition
is False.

Error type: ``ValueError``

C++ equivalent: ``TORCH_CHECK_VALUE``

Args:
    cond (:class:`bool`): If False, throw error

    message (Callable, optional): Callable that returns either a string or
        an object that has a ``__str__()`` method to be used as the error
        message. Default: ``None``
N)r¹  rÖ   r»  s     r   Ú_check_valuerÇ    rÅ  r   c                 ó$   • [        [        X5        g)a‚  Throws error containing an optional message if the specified condition
is False.

Error type: ``TypeError``

C++ equivalent: ``TORCH_CHECK_TYPE``

Args:
    cond (:class:`bool`): If False, throw error

    message (Callable, optional): Callable that returns either a string or
        an object that has a ``__str__()`` method to be used as the error
        message. Default: ``None``
N)r¹  rB  r»  s     r   Ú_check_typerÉ  $  s   € ô ”	˜4Õ)r   c                 ó&   • [        [        U U5        g)a—  Throws error containing an optional message if the specified condition
is False.

Error type: ``NotImplementedError``

C++ equivalent: ``TORCH_CHECK_NOT_IMPLEMENTED``

Args:
    cond (:class:`bool`): If False, throw error

    message (Callable, optional): Callable that returns either a string or
        an object that has a ``__str__()`` method to be used as the error
        message. Default: ``None``
N)r¹  ÚNotImplementedErrorr»  s     r   Ú_check_not_implementedrÌ  6  s   € ô ÜØàõ	r   c                 ó  • [        U5      (       d  [        S[        U5       35      eUR                  [        R
                  :X  d  [        SUR                   35      e[        XR                  " 5       R                  5       U5        g )Nzcond must be a tensor, but got z0cond tensor must have dtype torch.bool, but got )	rD   rB  r%  ÚdtyperÂ  r
  r¹  Ú_is_all_truerT  )r·  r8   r°  s      r   Ú_check_tensor_all_withrÐ  M  se   € Ü�T�?‰?ÜÐ9¼$¸t»*¸ÐFÓGÐGà�:‰:œŸ™Ó#ÜÐJÈ4Ï:É:È,ÐWÓXÐXä�
×-Ò-Ó/×4Ñ4Ó6¸Õ@r   c                 ó$   • [        [        X5        g)aÎ  Throws error containing an optional message if the specified condition
is False.

Error type: ``RuntimeError``

C++ equivalent: ``TORCH_CHECK_TENSOR_ALL``

Args:
    cond (:class:`torch.Tensor`): Tensor of dtype ``torch.bool``. If any
        element is ``False``, throw error

    message (Callable, optional): Callable that returns either a string or
        an object that has a ``__str__()`` method to be used as the error
        message. Default: ``None``
N)rÐ  r¥  r»  s     r   Ú_check_tensor_allrÒ  X  s   € ô  œ<¨Õ7r   )ÚeÚinfÚnanÚpiÚnewaxis)rÓ  rÖ  rÕ  rÔ  r×  )r1   )Ústorage)Ú_LegacyStorageÚ_StorageBaseÚ_warn_typed_storage_removalr2   r3   c                   ó4   • \ rS rSr\S 5       r\S 5       rSrg)r   i‹  c                 ó,   • [        SS9  U R                  $ ©Né   ©Ú
stacklevel©rÛ  Ú_dtyper  s    r   rÎ  ÚByteStorage.dtypeŒ  ó   € ä#¨qÒ1Ø�{‰{Ðr   c                 ó"   • [         R                  $ r…   )rÂ  Úuint8r  s    r   rã  ÚByteStorage._dtype‘  ó   € ä�{‰{Ðr   r   N©r¡  r¢  r£  r¤  r   rÎ  rã  r¨  r   r   r   r   r   ‹  ó(   † Øñó ðð ñó ór   r   c                   ó4   • \ rS rSr\S 5       r\S 5       rSrg)r#   i–  c                 ó,   • [        SS9  U R                  $ rÞ  râ  r  s    r   rÎ  ÚDoubleStorage.dtype—  rå  r   c                 ó"   • [         R                  $ r…   )rÂ  Údoubler  s    r   rã  ÚDoubleStorage._dtypeœ  ó   € ä�|‰|Ðr   r   Nrê  r   r   r   r#   r#   –  ó(   † Øñó ðð ñó ór   r#   c                   ó4   • \ rS rSr\S 5       r\S 5       rSrg)r%   i¡  c                 ó,   • [        SS9  U R                  $ rÞ  râ  r  s    r   rÎ  ÚFloatStorage.dtype¢  rå  r   c                 ó"   • [         R                  $ r…   )rÂ  r  r  s    r   rã  ÚFloatStorage._dtype§  ré  r   r   Nrê  r   r   r   r%   r%   ¡  rë  r   r%   c                   ó4   • \ rS rSr\S 5       r\S 5       rSrg)ÚHalfStoragei¬  c                 ó,   • [        SS9  U R                  $ rÞ  râ  r  s    r   rÎ  ÚHalfStorage.dtype­  rå  r   c                 ó"   • [         R                  $ r…   )rÂ  Úhalfr  s    r   rã  ÚHalfStorage._dtype²  ó   € ä�z‰zÐr   r   Nrê  r   r   r   rú  rú  ¬  ó(   † Øñó ðð ñó ór   rú  c                   ó4   • \ rS rSr\S 5       r\S 5       rSrg)r*   i·  c                 ó,   • [        SS9  U R                  $ rÞ  râ  r  s    r   rÎ  ÚLongStorage.dtype¸  rå  r   c                 ó"   • [         R                  $ r…   )rÂ  Úlongr  s    r   rã  ÚLongStorage._dtype½  r   r   r   Nrê  r   r   r   r*   r*   ·  r  r   r*   c                   ó4   • \ rS rSr\S 5       r\S 5       rSrg)r(   iÂ  c                 ó,   • [        SS9  U R                  $ rÞ  râ  r  s    r   rÎ  ÚIntStorage.dtypeÃ  rå  r   c                 ó"   • [         R                  $ r…   )rÂ  r   r  s    r   rã  ÚIntStorage._dtypeÈ  s   € ä�y‰yÐr   r   Nrê  r   r   r   r(   r(   Â  s(   † Øñó ðð ñó ór   r(   c                   ó4   • \ rS rSr\S 5       r\S 5       rSrg)r,   iÍ  c                 ó,   • [        SS9  U R                  $ rÞ  râ  r  s    r   rÎ  ÚShortStorage.dtypeÎ  rå  r   c                 ó"   • [         R                  $ r…   )rÂ  Úshortr  s    r   rã  ÚShortStorage._dtypeÓ  ré  r   r   Nrê  r   r   r   r,   r,   Í  rë  r   r,   c                   ó4   • \ rS rSr\S 5       r\S 5       rSrg)r!   iØ  c                 ó,   • [        SS9  U R                  $ rÞ  râ  r  s    r   rÎ  ÚCharStorage.dtypeÙ  rå  r   c                 ó"   • [         R                  $ r…   )rÂ  Úint8r  s    r   rã  ÚCharStorage._dtypeÞ  r   r   r   Nrê  r   r   r   r!   r!   Ø  r  r   r!   c                   ó4   • \ rS rSr\S 5       r\S 5       rSrg)r   iã  c                 ó,   • [        SS9  U R                  $ rÞ  râ  r  s    r   rÎ  ÚBoolStorage.dtypeä  rå  r   c                 ó"   • [         R                  $ r…   )rÂ  r
  r  s    r   rã  ÚBoolStorage._dtypeé  r   r   r   Nrê  r   r   r   r   r   ã  r  r   r   c                   ó4   • \ rS rSr\S 5       r\S 5       rSrg)ÚBFloat16Storageiî  c                 ó,   • [        SS9  U R                  $ rÞ  râ  r  s    r   rÎ  ÚBFloat16Storage.dtypeï  rå  r   c                 ó"   • [         R                  $ r…   )rÂ  Úbfloat16r  s    r   rã  ÚBFloat16Storage._dtypeô  ó   € ä�~‰~Ðr   r   Nrê  r   r   r   r  r  î  ó(   † Øñó ðð ñó ór   r  c                   ó4   • \ rS rSr\S 5       r\S 5       rSrg)ÚComplexDoubleStorageiù  c                 ó,   • [        SS9  U R                  $ rÞ  râ  r  s    r   rÎ  ÚComplexDoubleStorage.dtypeú  rå  r   c                 ó"   • [         R                  $ r…   )rÂ  Úcdoubler  s    r   rã  ÚComplexDoubleStorage._dtypeÿ  s   € ä�}‰}Ðr   r   Nrê  r   r   r   r(  r(  ù  s(   † Øñó ðð ñó ór   r(  c                   ó4   • \ rS rSr\S 5       r\S 5       rSrg)ÚComplexFloatStoragei  c                 ó,   • [        SS9  U R                  $ rÞ  râ  r  s    r   rÎ  ÚComplexFloatStorage.dtype  rå  r   c                 ó"   • [         R                  $ r…   )rÂ  Úcfloatr  s    r   rã  ÚComplexFloatStorage._dtype
  rò  r   r   Nrê  r   r   r   r/  r/    ró  r   r/  c                   ó4   • \ rS rSr\S 5       r\S 5       rSrg)ÚQUInt8Storagei  c                 ó,   • [        SS9  U R                  $ rÞ  râ  r  s    r   rÎ  ÚQUInt8Storage.dtype  rå  r   c                 ó"   • [         R                  $ r…   )rÂ  Úquint8r  s    r   rã  ÚQUInt8Storage._dtype  rò  r   r   Nrê  r   r   r   r6  r6    ró  r   r6  c                   ó4   • \ rS rSr\S 5       r\S 5       rSrg)ÚQInt8Storagei  c                 ó,   • [        SS9  U R                  $ rÞ  râ  r  s    r   rÎ  ÚQInt8Storage.dtype  rå  r   c                 ó"   • [         R                  $ r…   )rÂ  Úqint8r  s    r   rã  ÚQInt8Storage._dtype   ré  r   r   Nrê  r   r   r   r=  r=    rë  r   r=  c                   ó4   • \ rS rSr\S 5       r\S 5       rSrg)ÚQInt32Storagei%  c                 ó,   • [        SS9  U R                  $ rÞ  râ  r  s    r   rÎ  ÚQInt32Storage.dtype&  rå  r   c                 ó"   • [         R                  $ r…   )rÂ  Úqint32r  s    r   rã  ÚQInt32Storage._dtype+  rò  r   r   Nrê  r   r   r   rD  rD  %  ró  r   rD  c                   ó4   • \ rS rSr\S 5       r\S 5       rSrg)ÚQUInt4x2Storagei0  c                 ó,   • [        SS9  U R                  $ rÞ  râ  r  s    r   rÎ  ÚQUInt4x2Storage.dtype1  rå  r   c                 ó"   • [         R                  $ r…   )rÂ  Úquint4x2r  s    r   rã  ÚQUInt4x2Storage._dtype6  r%  r   r   Nrê  r   r   r   rK  rK  0  r&  r   rK  c                   ó4   • \ rS rSr\S 5       r\S 5       rSrg)ÚQUInt2x4Storagei;  c                 ó,   • [        SS9  U R                  $ rÞ  râ  r  s    r   rÎ  ÚQUInt2x4Storage.dtype<  rå  r   c                 ó"   • [         R                  $ r…   )rÂ  Úquint2x4r  s    r   rã  ÚQUInt2x4Storage._dtypeA  r%  r   r   Nrê  r   r   r   rR  rR  ;  r&  r   rR  rr  Ú_tensor_classes)ÚampÚrandomÚserialization)rS   )r5   r'   )r?   rA   rH   rN   rT   )rF   rM   c                  óþ   • [         R                  " 5       S:X  a  g[        SSS5      n [        [        S5      5        [        R
                  R                  U 5      (       d  [        SU -   5      eU R                  S5      $ )Nrî   r   rÂ  rl   Útorch_shm_managerz$Unable to find torch_shm_manager at zutf-8)	r¤   rÔ   r   r   rq   rr   rs   r¥  Úencode)rr   s    r   Ú_manager_pathr_  m  sc   € Ü‡‚Ó˜IÓ%ØÜ˜ %Ð)<Ó=€DÜ'¬°gÓ(>Ô?Ü�7‰7�>‰>˜$×ÑÜÐAÀDÑHÓIÐIØ�;‰;�wÓÐr   )Ú
unique_dimr<  Úsegment_reducec              #   ó„   #   • U  H6  n[        [        [        U5      [        R                  5      (       d  M2  Uv •  M8     g 7fr…   )r  r=  rÂ  rÎ  )rv   r?  s     r   rx   rx   ¥  s)   é € ð ÚˆT¤:¬g´e¸TÓ.BÄEÇKÁK×#P‡D�D’Zùs
   ‚1A ·	A )Ú_disable_dynamo)Ú_VFÚ
functionalc                 óÒ   • [        U 5      [        R                  La9  [        R                  " U 45      (       a  [        R
                  " [        U 4X5      $ U (       d  [        U5      eg)zAA wrapper around Python's assert which is symbolically traceable.N)r%  rÂ  r1   r  r#  r  Ú_assertrÕ   )Ú	conditionr°  s     r   rg  rg  Å  s\   € äˆIƒœeŸl™lÒ*¬y×/KÒ/KØ	ˆ÷0ñ 0ô ×.Ò.Ü�i�\ 9ó
ð 	
ö Ü˜WÓ%Ð%ð r   )r9   r@   rJ   Úset_grad_enabled)Ú
__config__Ú
__future__Ú_awaitsÚacceleratorÚautogradÚbackendsr€  ri   ÚdistributedÚdistributionsÚfftÚfuturesÚhubÚjitÚlinalgÚmpsÚmtiaÚmultiprocessingÚnestedÚnnÚoptimr  ÚprofilerÚsparseÚspecialÚtestingÚtypesÚutilsÚversionÚxpu)Úwindows)Úao)Ú
_size_docsÚ_storage_docsÚ_tensor_docsÚ_torch_docsc                  ó   • g)z?Returns whether PyTorch was built with _GLIBCXX_USE_CXX11_ABI=1Tr   r   r   r   Úcompiled_with_cxx11_abirŒ  	  s   € àr   )Ú_libraryÚ_ops)Úops)Úclassesz.opsz.classes)Úquantization)Úquasirandom)Úregister_after_fork)rG   )Úmasked)Ú_symeigÚeigÚlstsqÚmatrix_rankÚsolve)Úfrom_dlpackÚ	to_dlpackc                   óh   • \ rS rSrSrS rS rS\S-  4S jrS\	\\
4   S-  4S	 jrS
 rS rS rSrg)Ú_TorchCompileInductorWrapperiU	  Úinductorc                 óô  • SSK Jn  0 U l        X0l        U R	                  U5        U R                  U5        U R                  UR                  S5      5        S n[        [        S5      (       a'  SSK	J
n  U" [        [        R                  SS5      5      nU R                  R                  SS	5      (       aD  U(       a  US
:  d  [        5       (       d'  S[        R                   S'   S[        R                   S'   g g g )Nr   ©ÚCompilerBisectorrž  rƒ  )ÚTorchVersionri   z0.0útriton.cudagraphsFz12.6Ú1ÚDISABLE_CUPTI_LAZY_REINITÚ0ÚTEARDOWN_CUPTI)Ú!torch._inductor.compiler_bisectorr¡  r–  ÚdynamicÚ
apply_modeÚapply_optionsÚget_config_changerœ   rÂ  Útorch.torch_versionr¢  r=  rƒ  Úgetr   rq   r®   )r  rñ   Úoptionsr©  r¡  r¯   r¢  s          r   r  Ú%_TorchCompileInductorWrapper.__init__X	  sÅ   € ÝFà')ˆŒØŒØ�‰˜ÔØ×Ñ˜7Ô#Ø×ÑÐ+×=Ñ=¸jÓIÔJàˆÜ”5˜)×$Ñ$Ý8á'¬´·±¸vÀuÓ(MÓNˆLà�;‰;�?‰?Ð.°×6Ñ6Þ˜l¨VÓ3ÜD×FÑFà69ŒB�J‰JÐ2Ñ3ð
 ,/ŒB�J‰JÐ'Ò(ð Gð 7r   c                 ó¢   • [        U[        5      =(       a9    U R                  UR                  :H  =(       a    U R                  UR                  :H  $ r…   )r  r�  r–  r©  r#  s     r   rC  Ú#_TorchCompileInductorWrapper.__eq__r	  s<   € ä�uÔ:Ó;÷ .Ø—‘˜uŸ|™|Ñ+÷.à—‘ §¡Ñ-ð	
r   rñ   Nc                 óp   • U(       a/  US:w  a(  SSK Jn  U R                  U" XR                  5      5        g g g )Nr¡  r   )Úlist_mode_options)Útorch._inductorr´  r«  r©  )r  rñ   r´  s      r   rª  Ú'_TorchCompileInductorWrapper.apply_modey	  s.   € Þ�D˜IÓ%Ý9à×ÑÑ0°·|±|ÓDÕEð &ˆ4r   r¯  c           
      óæ  • U(       d  g SSK Jn  UR                  5       nUR                  5        H¿  u  pEUR	                  SS5      nXc;  a(  [        SU S[        UR                  5       5       35      eUR                  U5      n[        U5      cP  [        XW5      (       d@  [        U5      R                  n[        X6   5      R                  n	[        SU SU S	U	 35      eXPR                  U'   MÁ     g )
Nr   ©r–  Ú-r€   zUnexpected optimization option z, known options are zUnexpected type of attr r"  z should be )rµ  r–  Úget_config_copyÚitemsr˜   r¥  ÚlistÚkeysÚget_typeÚ_get_originr  r%  r¡  )
r  r¯  r–  Úcurrent_configÚkeyÚvalÚ	attr_nameÚ	attr_typeÚval_type_strÚexpected_type_strs
             r   r«  Ú*_TorchCompileInductorWrapper.apply_options	  sí   € ÞØå*à*0×*@Ñ*@Ó*BˆàŸ™ž‰HˆCØŸ™ C¨Ó-ˆIØÓ.Ü"Ø5°c°UÐ:NÌtÐTb×TgÑTgÓTiÓOjÐNkÐlóð ð Ÿ™¨	Ó2ˆIô ˜9Ó%Ñ-Ü! #×1Ñ1Ü#'¨£9×#5Ñ#5�LÜ(,¨^Ñ-FÓ(G×(PÑ(PÐ%Ü&Ø2°3°%°v¸l¸^È;ÐWhÐViÐjóð ð &)�K‰K˜	Ó"ò# (r   c                 ó0   • SSK Jn  U" XU R                  S9$ )Nr   )Ú
compile_fx©Úconfig_patches)Útorch._inductor.compile_fxrÉ  r–  )r  Úmodel_Úinputs_rÉ  s       r   Ú__call__Ú%_TorchCompileInductorWrapper.__call__š	  s   € Ý9á˜&¸$¿+¹+ÑFÐFr   c                 ó.   • SSK Jn  U" U R                  S9$ )Nr   )Úget_patched_config_dictrÊ  )rÌ  rÒ  r–  )r  rÒ  s     r   Úget_compiler_configÚ0_TorchCompileInductorWrapper.get_compiler_configŸ	  s   € ÝFá&°d·k±kÑBÐBr   c                 óÆ   • SSK Jn  SU R                  ;   d  UR                  R                  (       a0  U R                  R	                  SS5      (       a  SSKJn  U" 5         g g g )Nr   r¸  r£  T)Úreset_cudagraph_trees)rµ  r–  ÚtritonÚ
cudagraphsr®  Útorch._inductor.cudagraph_treesrÖ  )r  r–  rÖ  s      r   ÚresetÚ"_TorchCompileInductorWrapper.reset¤	  sG   € Ý*à $§+¡+Ó-°·±×1I×1IØ�{‰{�‰Ð2°D×9Ñ9ÝQá%Õ'ð :ð 2Jr   )r–  r©  )r¡  r¢  r£  r¤  Úcompiler_namer  rC  rô  rª  ÚdictÚ_Anyr«  rÏ  rÓ  rÚ  r¨  r   r   r   r�  r�  U	  sM   † Ø€Mò/ò4
ðF˜s T™zô Fð) T¨#¨t¨)¡_°tÑ%;ô )ò6Gò
Cõ
(r   r�  c                   ó8   ^ • \ rS rSrSrU 4S jrU 4S jrSrU =r$ )Ú_TorchCompileAOTInductorWrapperi®	  Úaotinductorc                 ór   >• [         TU ]  XU5        U R                  SS05        U R                  SS05        g )NÚcpp_wrapperTzaot_inductor.package)Úsuperr  r«  )r  rñ   r¯  r©  rm  s       €r   r  Ú(_TorchCompileAOTInductorWrapper.__init__±	  s9   ø€ Ü‰Ñ˜¨Ô0Ø×Ñ˜M¨4Ð0Ô1Ø×ÑÐ2°DÐ9Õ:r   c                 óú  >• SSK Jn  SSKJn  SSKJn  SSKJn  U" U5      nU(       a  UR                  R                  USS5      OU" 5       nUR                  S5         U   [        R                  R                  R                  SS5         [        T	U ]=  X5      sS S S 5        sS S S 5        sS S S 5        $ ! , (       d  f       O= f S S S 5        O! , (       d  f       O= fS S S 5        g ! , (       d  f       g = f)	Nr   )Únullcontext)Úmock)Údetect_fake_mode)ÚVÚallow_non_fake_inputsTÚenable_autograd_for_aot)Ú
contextlibrç  Úunittestrè  Útorch._guardsré  Útorch._inductor.virtualizedrê  Úpatchr¦  Úset_aot_compilationrÂ  r•  r–  rä  rÏ  )
r  rÍ  rÎ  rç  rè  ré  rê  Ú	fake_modeÚctxrm  s
            €r   rÏ  Ú(_TorchCompileAOTInductorWrapper.__call__¶	  s´   ø€ Ý*Ý!å2Ý1á$ WÓ-ˆ	ö ð �J‰J×Ñ˜iÐ)@À$ÔGá“ð 	ð ×!Ñ! $Õ'ÚÜ�O‰O×"Ñ"×(Ñ(Ð)BÀDÕIä‘7Ñ# FÓ4÷ JÐI÷ ˆC÷ (Ñ'çIÕIúÐI÷ �CŽCú÷ (×'Ö'úsB   ÁC,Á!+CÂB7Â	CÂ$	C,Â7
CÃCÃ		C,Ã
C 	ÃC,Ã,
C:r   )	r¡  r¢  r£  r¤  rÜ  r  rÏ  r¨  Ú__classcell__)rm  s   @r   rà  rà  ®	  s   ø† Ø!€Mõ;÷
5ó 5r   rà  c                   ó,   • \ rS rSrS rS rS rS rSrg)Ú_TorchCompileWrapperiË	  c                 óD  • SSK Jn  [        U[        5      (       a  Xl        O3[        US5      (       a  UR                  U l        O[        U5      U l        X@l        U" U5      U l        0 U l	        U(       a  US:w  a  X R                  S'   U(       a  X0R                  S'   g g )Nr   )Úlookup_backendr¡  r¡  rñ   r¯  )
Útorch._dynamo.backends.registryrú  r  rô  rÜ  rœ   r¡  r©  Úcompiler_fnÚkwargs)r  Úbackendrñ   r¯  r©  rú  s         r   r  Ú_TorchCompileWrapper.__init__Ì	  s‚   € ÝBä�gœs×#Ñ#Ø!(ÕÜ�W˜j×)Ñ)Ø!(×!1Ñ!1ˆDÕä!$ W£ˆDÔØŒÙ)¨'Ó2ˆÔØˆŒæ�D˜IÓ%Ø"&�K‰K˜ÑÞØ%,�K‰K˜	Ò"ð r   c                 óâ   • [        U[        5      =(       aY    U R                  UR                  :H  =(       a9    U R                  UR                  :H  =(       a    U R                  UR                  :H  $ r…   )r  rø  rü  rý  r©  r#  s     r   rC  Ú_TorchCompileWrapper.__eq__Þ	  sW   € ä�uÔ2Ó3÷ .Ø× Ñ  E×$5Ñ$5Ñ5÷.à—‘˜uŸ|™|Ñ+÷.ð —‘ §¡Ñ-ð		
r   c                 ó<   • U R                   " X40 U R                  D6$ r…   )rü  rý  )r  rÍ  rÎ  s      r   rÏ  Ú_TorchCompileWrapper.__call__æ	  s   € Ø×Ò Ñ?°4·;±;Ñ?Ð?r   c                 óp   • [        U R                  S5      (       a  U R                  R                  5         g g )NrÚ  )rœ   rü  rÚ  r  s    r   rÚ  Ú_TorchCompileWrapper.reseté	  s,   € Ü�4×#Ñ# W×-Ñ-Ø×Ñ×"Ñ"Õ$ð .r   )rü  rÜ  r©  rý  N)	r¡  r¢  r£  r¤  r  rC  rÏ  rÚ  r¨  r   r   r   rø  rø  Ë	  s   † ò-ò$
ò@õ%r   rø  Ú_InputTÚ_RetTrž  ©Ú	fullgraphr©  rþ  rñ   r¯  ÚdisableÚmodelr	  r©  rþ  r¯  r
  c                ó   • g r…   r   ©r  r	  r©  rþ  rñ   r¯  r
  s          r   r7   r7   ò	  s   € ð !$r   c                ó   • g r…   r   r  s          r   r7   r7   ÿ	  s	   € ð ILr   c                ó"  ^^^^^^• SSK n[        R                  " S5        [        R                  S:¼  a  [        S5      eUR                  S5      S:X  a  [        R                  S:  a  [        S	5      eU c5  S
[        [        [        4   S[        [        [        4   4UUUUUU4S jjnU$ Tb  Tb  [        S5      eTc  Tc  SmSSK
Jn	  U	R                  5       =n
(       aA  SSKJs  Jn  UR                   R"                  (       a  U
S:X  a  [%        T[&        5      (       a  U
mSnSnT(       a9  [%        T[(        5      (       a$  TR+                  SS5      nTR+                  SS5      n[,        R.                  R1                  5       (       a)  SSKJn  U" 5       (       d  [6        R8                  " SSS9  U $ TS:X  a#  U(       a  [;        TTT5      mO[=        TTT5      mO[?        TTTT5      m[,        R@                  RC                  TTTTUS9" U 5      $ )a‡  
Optimizes given model/function using TorchDynamo and specified backend.
If you are compiling an :class:`torch.nn.Module`, you can also use :meth:`torch.nn.Module.compile`
to compile the module inplace without changing its structure.

Concretely, for every frame executed within the compiled region, we will attempt
to compile it and cache the compiled result on the code object for future
use.  A single frame may be compiled multiple times if previous compiled
results are not applicable for subsequent calls (this is called a "guard
failure"), you can use TORCH_LOGS=guards to debug these situations.
Multiple compiled results can be associated with a frame up to
``torch._dynamo.config.recompile_limit``, which defaults to 8; at which
point we will fall back to eager.  Note that compile caches are per
*code object*, not frame; if you dynamically create multiple copies of a
function, they will all share the same code cache.

Args:
   model (Callable or None): Module/function to optimize
   fullgraph (bool): If False (default), torch.compile attempts to discover compilable regions
    in the function that it will optimize. If True, then we require that the entire function be
    capturable into a single graph. If this is not possible (that is, if there are graph breaks),
    then this will raise an error. This also opts into unbacked semantics, notably it will turn on
    capture_scalar_outputs and capture_dynamic_output_shape_ops on by default.
   dynamic (bool or None): Use dynamic shape tracing.  When this is True, we will up-front attempt
    to generate a kernel that is as dynamic as possible to avoid recompilations when
    sizes change.  This may not always work as some operations/optimizations will
    force specialization; use TORCH_LOGS=dynamic to debug overspecialization.
    When this is False, we will NEVER generate dynamic kernels, we will always specialize.
    By default (None), we automatically detect if dynamism has occurred and compile a more
    dynamic kernel upon recompile.
   backend (str or Callable): backend to be used

    - "inductor" is the default backend, which is a good balance between performance and overhead

    - Non experimental in-tree backends can be seen with `torch._dynamo.list_backends()`

    - Experimental or debug in-tree backends can be seen with `torch._dynamo.list_backends(None)`

    - To register an out-of-tree custom backend:
      https://docs.pytorch.org/docs/main/user_guide/torch_compiler/torch.compiler_custom_backends.html#registering-custom-backends
   mode (str): Can be either "default", "reduce-overhead", "max-autotune" or "max-autotune-no-cudagraphs"

    - "default" is the default mode, which is a good balance between performance and overhead

    - "reduce-overhead" is a mode that reduces the overhead of python with CUDA graphs,
      useful for small batches.  Reduction of overhead can come at the cost of more memory
      usage, as we will cache the workspace memory required for the invocation so that we
      do not have to reallocate it on subsequent runs.  Reduction of overhead is not guaranteed
      to work; today, we only reduce overhead for CUDA only graphs which do not mutate inputs.
      There are other circumstances where CUDA graphs are not applicable; use TORCH_LOGS=perf_hints
      to debug.

    - "max-autotune" is a mode that leverages Triton or template based matrix multiplications
      on supported devices and Triton based convolutions on GPU.
      It enables CUDA graphs by default on GPU.

    - "max-autotune-no-cudagraphs" is a mode similar to "max-autotune" but without CUDA graphs

    - To see the exact configs that each mode sets you can call `torch._inductor.list_mode_options()`

   options (dict): A dictionary of options to pass to the backend. Some notable ones to try out are

    - `epilogue_fusion` which fuses pointwise ops into templates. Requires `max_autotune` to also be set

    - `max_autotune` which will profile to pick the best matmul configuration

    - `fallback_random` which is useful when debugging accuracy issues

    - `shape_padding` which pads matrix shapes to better align loads on GPUs especially for tensor cores

    - `triton.cudagraphs` which will reduce the overhead of python with CUDA graphs

    - `trace.enabled` which is the most useful debugging flag to turn on

    - `trace.graph_diagram` which will show you a picture of your graph after fusion

    - `guard_filter_fn` that controls which dynamo guards are saved with compilations.
      This is an unsafe feature and there is no backward compatibility guarantee provided
      for dynamo guards as data types.
      For stable helper functions to use, see the documentations in `torch.compiler`, for example:
      - `torch.compiler.skip_guard_on_inbuilt_nn_modules_unsafe`
      - `torch.compiler.skip_guard_on_all_nn_modules_unsafe`
      - `torch.compiler.keep_tensor_guards_unsafe`

    - For inductor you can see the full list of configs that it supports by calling `torch._inductor.list_options()`
   disable (bool): Turn torch.compile() into a no-op for testing

Example::

    @torch.compile(options={"triton.cudagraphs": True}, fullgraph=True)
    def foo(x):
        return torch.sin(x) + torch.cos(x)

r   Nztorch.compile)rß  é   z.torch.compile is not supported on Python 3.15+ÚPy_GIL_DISABLEDrd   )rß  é   rß  zetorch.compile is not supported on Python < 3.13.3 built with GIL disabled. Please use Python 3.13.3+.r  r   c           
      ó>   >• U c  [        S5      e[        U TTTTTTS9$ )NzModel can't be Noner  )r¥  r7   )r  rþ  r
  r©  r	  rñ   r¯  s    €€€€€€r   r>  Úcompile.<locals>.fn‰
  s6   ø€ Ø‰}Ü"Ð#8Ó9Ð9ÜØØ#ØØØØØñð r   zVEither mode or options can be specified, but both can't be specified at the same time.r¡  r   rž  FÚguard_filter_fnÚuse_aoti)Ú_in_hop_compilez?torch.compile is ignored when called inside torch.export regionr¤  rà  )rþ  Únopythonr©  r
  r  )"rŒ   rV  Ú_log_api_usage_oncer�   Úversion_infor¥  r“   Ú	_Callabler  r  r¨  r¡  Úget_backendr”  r•  r–  Útest_configsÚ'bisect_keep_custom_backend_for_inductorr  rô  rÝ  ÚpoprÂ  ÚcompilerÚis_exportingÚtorch._higher_order_ops.utilsr  Úwarningsr¢  rà  r�  rø  Ú_dynamoÚoptimize)r  r	  r©  rþ  rñ   r¯  r
  rŒ   r>  r¡  Úbisect_backendr™  r  r  r  s    ``````        r   r7   r7   
  sõ  ý€ óV ä×Ò˜?Ô+Ü
×Ñ˜7Ó"ÜÐKÓLÐLØ	×	!Ñ	!Ð"3Ó	4¸Ó	9¼c×>NÑ>Nð Ró ?ô
 ð)ó
ð 	
ð �}ð	”i¤¬ Ñ/ð 	´I¼gÄu¸nÑ4M÷ 	ô 	ð ˆ	àÑ˜GÑ/ÜØdó
ð 	
ð �|˜™ØˆåBà)×5Ñ5Ó7Ð7€~Õ7ß8Ð8ð
 ×(Ñ(×P×PØ *Ó,Ü˜w¬×,Ñ,à$ˆGà€OØ€HÞ”:˜g¤t×,Ñ,Ø!Ÿ+™+Ð&7¸Ó>ˆØ—;‘;˜z¨5Ó1ˆä‡~�~×"Ñ"×$Ñ$ÝAá× Ñ Ü�MŠMØQØòð
 ˆLà�*ÓÞÜ5°d¸GÀWÓM‰Gä2°4¸À'ÓJ‰Gä& w°°g¸wÓGˆä�=‰=×!Ñ!ØØØØØ'ð "ñ ð óð r   c           	      ó4  • [         R                  " U 5      R                  n [        R                  [
           n[        X 5      (       a  [        SU  S[        X 5       S35      e[        X U5        SR                  [
        U /5      nU[        R                  U'   g)zéRegister an external runtime module of the specific :attr:`device_type`
supported by torch.

After the :attr:`module` is registered correctly, the user can refer
the external runtime module as part of torch with attribute torch.xxx.
zThe runtime module of 'z$' has already been registered with 'Ú'r   N)rÂ  ry  r%  r�   rc  r¡  rœ   r¥  r=  Úsetattrrt   )Údevice_typerf  ÚmÚtorch_module_names       r   Ú_register_device_moduler-  Ï
  sŒ   € ô —,’,˜{Ó+×0Ñ0€KÜ�‰”HÑ€AÜˆq×ÑÜØ% k ]ð 3%Ü%,¨QÓ%<Ð$=¸Qð@ó
ð 	
ô ˆA˜FÔ#ØŸ™¤(¨KÐ!8Ó9ÐØ%+„C‡K�KÐ!Ò"r   )r:   ÚfuncÚlibraryÚreturn_types)r8   Ú
while_loop)rc   Ú
_c10d_init)Ú_meta_registrationsÚTORCH_CUDA_SANITIZER)Úfx)r   c                   ó€   • \ rS rSr% \R
                  R                  SS5      r0 r\	\
\\4   \4   \S'   \S 5       rSrg)Ú_TritonLibraryi  r×  ÚDEFÚ	ops_tablec                 óÖ   • X4U R                   ;  aI  U R                  R                  U5        U R                  R                  SU-   X45        X0R                   X4'   U R                   X4   $ )Nztriton::)r9  rm   ÚdefineÚimpl)ÚclsÚop_keyÚfull_schemaÚop_implÚdispatch_keys        r   Ú
registerOpÚ_TritonLibrary.registerOp  sY   € àÐ!¨¯©Ó6Ø�G‰G�N‰N˜;Ô'Ø�G‰G�L‰L˜ fÑ,¨gÔDØ4;�M‰M˜6Ð0Ñ1à�}‰}˜fÐ3Ñ4Ð4r   r   N)r¡  r¢  r£  r¤  rÂ  r/  rk   rm   r9  rÝ  r§  rô  r  Ú__annotations__ÚclassmethodrB  r¨  r   r   r   r7  r7    sF   ‡ Ø
�-‰-×
Ñ
 ¨%Ó
0€CØ24€Iˆt�E˜#˜s˜(‘O YÐ.Ñ/Ó4àñ5ó ó5r   r7  )Úhas_mpsÚhas_cudaÚ	has_cudnnÚ
has_mkldnn)r$  r•  Ú_subclassesÚonnx>   rK  r$  Ú_exportr•  c           	      ó"  • [         R                  U 5      nUb:  SS KnUR                  " SU  SUR                   SUR
                   S3SS9  U" 5       $ U [        ;   a  [        R                  " SU  3[
        5      $ [        S[
         S	U  S35      e)
Nr   r(  z' is deprecated, please use 'r   z()'r¤  rà  zmodule 'z' has no attribute ')
Ú_deprecated_attrsr®  r#  r¢  r¢  r¡  Ú_lazy_modulesÚ	importlibÚimport_moduleÚAttributeError)r?  Úreplacementr#  s      r   Ú__getattr__rT  1  s›   € ä'×+Ñ+¨DÓ1ˆØÑ"Ûà�MŠMØ�D�6Ð6°{×7MÑ7MÐ6NÈaÐP[×PdÑPdÐOeÐehÐiØòñ “=Ð ð ”=Ó Ü×*Ò*¨Q¨t¨f¨:´xÓ@Ð@ä˜x¬ zÐ1EÀdÀVÈ1ÐMÓNÐNr   c                 óŒ  • [        U [        R                  5      (       a  U R                  nOq[        U [        5      (       a!  [        R                  " U 5      R                  nO;U c)  [        R
                  R                  5       R                  nO[        SU  S35      e[        [        US5      nUc  [        SU SU S35      eU$ )zÆ
Returns the module associated with a given device(e.g., torch.device('cuda'), "mtia:0", "xpu", ...).
If no device is given, return the module for the current accelerator or CPU if none is present.
NzInvalid value of device 'z$', expect torch.device, str, or NonezDevice 'z<' does not have a corresponding module registered as 'torch.z'.)	r  rÂ  ry  r%  rô  rV  Ú_get_acceleratorr¥  r=  )ry  Údevice_module_nameÚdevice_modules      r   r=   r=   D  s½   € ô �&œ%Ÿ,™,×'Ñ'Ø#Ÿ[™[ÑÜ	�FœC×	 Ñ	 Ü"Ÿ\š\¨&Ó1×6Ñ6ÑØ	‰ä"ŸX™X×6Ñ6Ó8×=Ñ=ÑäØ'¨ xÐ/SÐTó
ð 	
ô œEÐ#5°tÓ<€MØÑÜØÐ)Ð*Ð*fÐgyÐfzÐz|Ð}ó
ð 	
ð Ðr   r2  r&  c                 ó.   • [         R                  " XUS9  g)a)  
This indicates that a given int is size-like, and can be used in any context where a size is expected.
You will typically use this when reading out integers from Tensors, e.g., max.item() or lengths.tolist()
which then need to be used as tensor constructors. Providing these assertions to PyTorch can help resolve
  GuardOnDataDependentSymNode errors upon export, since we cannot guard on unbacked SymInts.

This function has unusual semantics in some circumstances in framework
code, we will treat this int as >= 2 (when we do a size-oblivious guard).
This makes it easier to use the unbacked int in size contexts,
as we will often attempt to guard on a size being zero/one
(e.g., when computing the contiguity of a tensor, or testing if
broadcasting can occur), which will not work on unbacked SymInts.
However, if we conservatively assume that the size is not zero/one, we will
end up with a graph that will still work even if the size is zero/one.

For more details, see https://docs.google.com/document/d/1HSuTTVvYH1pTew89Rtpeu84Ht3nQEFTYhAX3Ypa_xJs/edit
```
)r2  r&  N)rÂ  Úsym_constrain_range_for_size)Úsymbolr2  r&  s      r   Ú_constrain_as_sizer\  ]  s   € ô. 
×&Ò& v¸CÓ@r   )Ú_loggingc                  óº   • SSK Jn   SnU " US9nU H  n UR                  5       nU" 5         M     g! [         a  n[	        SUR
                   S35      UeSnAff = f)z�
Leverage the Python plugin mechanism to load out-of-the-tree device extensions.
See this RFC: https://github.com/pytorch/pytorch/issues/122468
r   )Úentry_pointsztorch.backends)Úgroupz&Failed to load the backend extension: zN. You can disable extension auto-loading with TORCH_DEVICE_BACKEND_AUTOLOAD=0.N)Úimportlib.metadatar_  rF   rö   r¥  r?  )r_  Ú
group_nameÚbackend_extensionsÚbackend_extensionÚ
entrypointrÆ   s         r   Ú_import_device_backendsrf  }  sz   € õ
 0à!€JÙ%¨JÑ7Ðã/Ðð		à*×/Ñ/Ó1ˆJáŽLò 0øô ó 	ÜØ8Ð9J×9OÑ9OÐ8Pð Q_ð `óð ðûð	ús   •1±
A»AÁAc                  ó6   • [         R                  " SS5      S:H  $ )a>  
Whether autoloading out-of-the-tree device extensions is enabled.
The switch depends on the value of the environment variable
`TORCH_DEVICE_BACKEND_AUTOLOAD`.

Returns:
    bool: Whether to enable autoloading the extensions. Enabled by default.

Examples:
    >>> torch._is_device_backend_autoload_enabled()
    True
ÚTORCH_DEVICE_BACKEND_AUTOLOADr¤  )rq   rŽ   r   r   r   Ú#_is_device_backend_autoload_enabledri  ”  s   € ô �9Š9Ð4°cÓ:¸cÑAÐAr   c                 ó   • [        U 5      nU[        R                  L a$  [        R                  " U [        R
                  SS9$ U[        R                  L a$  [        R                  " U [        R                  SS9$ [        R                  " U 5      $ )zæ
Like torch.as_tensor, but when given Python data types it will keep
them in full precision.  Used for calling convention for Dynamo.
Python scalars (float, int) are always created on CPU to avoid being
affected by DeviceContext.
r€  )rÎ  ry  )r%  r•   r  rÂ  Ú	as_tensorÚfloat64r   Úint64)rQ  Útys     r   Ú_as_tensor_fullprecro  ¥  sb   € ô 
ˆa‹€BØ	ŒX�^‰^ÒÜ�Š˜q¬¯©¸eÑDÐDØ	Œx�|‰|Ò	Ü�Š˜q¬¯©¸EÑBÐBä�Š˜qÓ!Ð!r   )r   N)Tr…   )r   ztorch.device)ry  r   r   N)r�  ztorch.dtyper   N)NN(S  r¥  r•   rš   Ú	functoolsr~   rP  r`  r-  rq   r¤   r�   r¨   Ú	threadingr#  Úcollections.abcr   r  Útypingr   rÞ  r   r¿  r   Ú	_overloadr   r   Ú_TypeVarÚtyping_extensionsr	   Ú_deprecatedr
   Ú
_ParamSpecr   Ú_TypeIsr
  r   Útorch._utilsr   Ú_syncr   r   Útorch._utils_internalr   r   r   r   r   r­  r   Útorch.typesr   r   Ú__all__ÚsortedrÕ   ro   re   Ú
initializeÚImportErrorrÇ   rô  r¼  rÐ   rÙ   r¦   rì   rü   rŽ   rÔ   ÚgetdlopenflagsÚ	old_flagsÚsetdlopenflagsró   Ú	RTLD_LAZYÚtorch._Cr0   r/   r.   r^   rX   rZ   r\   r§  r%  r$  r]   r_   rA  Ú__fnÚ__nameÚ
__sym_namer£  r¡  ÚglobalsrO  Úappendr[   rY   rU  rV  Ú_C_for_compiled_checkr’   r©   rª   rÂ  Ú__objr_  Úendswithr=  r¶  Úisclassr¢  Údelattrrc  re  r`   rD   rC   Úlocalr†  r;   rO   rP   r�  rb   r4   rB   r   rQ   r<   r>   rR   rU   rE   r¹  rÃ  ÚFutureWarningrÁ  rÄ  rÇ  rÉ  rÌ  rÐ  rÒ  rÓ  rÔ  rÕ  rÖ  r×  rD  r™   Útorch._tensorr1   rØ  Útorch.storagerÙ  rÚ  rÛ  r2   r3   r   r#   r%   rú  r*   r(   r,   r!   r   r  r(  r/  r6  r=  rD  rK  rR  rr  r]  rX  rY  rZ  r[  Útorch._tensor_strrS   Ú	torch.ampr5   r'   Útorch.randomr?   rA   rH   rN   rT   Útorch.serializationrF   rM   r_  Útorch._C._VariableFunctionsra  Ú_segment_reduceÚPRIVATE_OPSÚ_VariableFunctionsrb  Útorch._compilerc  rd  re  Útorch.functionalrg  Útorch.autogradr9   r@   rJ   ri  rj  rk  rl  rm  rn  ro  r€  ri   rp  rq  rr  rs  rt  ru  rv  rw  rx  ry  rz  r{  r|  r  r}  r~  r  r€  r�  r‚  rƒ  r„  Útorch.signalr…  r†  Útorch.nn.intrinsicÚtorch.nn.qatÚtorch.nn.quantizableÚtorch.nn.quantizedÚ_init_namesr‡  rˆ  r‰  rŠ  rŒ  r�  rŽ  Ú
torch._opsr�  Útorch._classesr�  rd  r‘  r’  Úcontiguous_formatÚlegacy_contiguous_formatÚtorch.multiprocessing._atforkr“  Úget_num_threadsÚtorch._lobpcgrG   ÚatenÚquantized_lstmÚquantized_grur”  Útorch._linalg_utilsr•  Úsymeigr–  r—  r˜  r™  Útorch.utils.dlpackrš  r›  r�  rà  rø  r  r  rÝ  r7   r-  r:   r.  r/  r0  Útorch._higher_order_opsr8   r1  Ú
torch.funcrc   rœ   Ú%torch.distributed._meta_registrationsr3  Úcoll_meta_registrationsr®   Útorch.cuda._sanitizerÚ
_sanitizerÚcsanÚenable_cuda_sanitizerr  r5  Ú_initr   r7  Úis_builtrÜ   Úis_availableÚmkldnnrN  r$  r•  rJ  rK  rO  rT  Úcachery  r=   r\  r]  Ú
_init_logsrf  ri  ro  r   r   r   Ú<module>rÁ     s  ðòó Û Û Û Û Û Û Û 	Û Û 
Û Û Û Ý 1÷õ ÷ñ ð˜hŸm™mô ÷ñ ÷
õ õ ;ö ß/òH€ðV ‰f�W‹oÓÙ
Ð6Ó
7Ð7ðÝð ×ÒÔØð ‡<�<�7Óôu/ñn ÔØð(˜cð (¨sð (¸cð (ÀdÈ3Áiô (ñ( #ð °ð Àð ÐPTõ ñ$#I˜G d™Nð #I°dõ #IôN"CöJ " R§Y¢YÐ/F×%GÑ%GØ‡O‚OÓ˜Ó"ð$ ×"Ò"Ó$€IØ×Ò�r—~‘~¨¯©Ñ4Ô5äà×Ò�yÔ!Ùö ÙÔÜ÷Bñ B÷Jw2ñ w2÷tJ0ñ J0òZò"òò"ð:"˜u U¨4°¨9Ñ%5°u¸TÀ3¸YÑ7GÐ%GÑHô "ò$"ò*Lò.
ð (Ñ €€fˆjó€Fð ˜˜Ð!€JÙ˜FÓ#€DØ(2Ð2€DÔ˜œØ �GƒIˆjÓñ!ð& 	ˆ&�*Ð.ñ ‹9�[Ñ!€Ø ‡�ˆzÔ ò
ò%ð
å'õ2 ð �€ˆÙ�"Žg€FØˆa�y�CÓ §¡°× 7Ñ 7Ø�‰�vÔÙ˜˜FÓ#ˆÙ�E�?‰?˜gŸošo¨e×4Ñ4Ø×Ñ 8Ó+àð "ó ð
 (0�EÖ$ññ ,ñ 5ð 
�<Õ	á�—‘˜HÑ% vÖ.ñ ð" ˆEæô
?ñ % RÔ(Ø(ð "�$ð  "˜cô  "ðF)�4ð )˜w ~Ñ6ô )ð)�Dð ) §¡ô )ð< #ŸšÓ*Ð ôôB;;ð|#˜t NÑ3°cÑ9ð #Àô #ô>2ðp  %òR@Ø
�-‰-ðR@ð �}‰}ðR@ð 
õ	R@ðj.¨h¯m©mô .ð8°x·}±}ô 8ð)
¨X¯\©\¸CÑ-?ð )
ÀDô )
ðX h§l¡lô ð. cô .ð?0¨Cð ?0°Dô ?0ðD
�x—}‘}ð 
¨Dô 
ð  §¡ô  ð (à
�-‰-˜'Ñ
!ð (ð �r˜3�wÑô (ôF-ñ$ ð!àñð
#¨4õ #óð
#ô>+ô$+ô$*ô$ô.Aô8÷2 !Ó  ð €ˆÓ à ‡‚Ò3Ô 4õ !õ %÷õ ô�.ô ô�Nô ô�>ô ô�.ô ô�.ô ô�ô ô�>ô ô�.ô ô�.ô ô�nô ô˜>ô ô˜.ô ô�Nô ô�>ô ô�Nô ô�nô ô�nô ð ØØØØØØØØØØØØØØØØØØð'>Ð �#�d˜<¨.Ñ8Ñ9Ñ:ó ñ. .1«U€��T˜.Ñ)Ñ*Ó 2÷ OÑ NÝ .ß *ß VÕ Vß *ò ð × Ò ‘-“/Ô "àö ô .ð %€OØð €à�€ˆÙ�"×'Ò'Ö(€FØ×Ò˜×Ñ &¨KÓ"7ÙÙ�B×)Ò)¨6Ó2€EØ€EÔàÐ!Ó!à!‰‹	�&ÑØ�v‘ˆØ�GƒIˆfÑØ×Ò˜S×!Ó!Ø�‰�vÖñ )ð ˆEó ð ‡‚ñ Ù˜”Zóô õ +÷ 7Ü ð Øò	&÷*ó ÷÷ ÷ ÷ ÷ ÷ ÷ ÷ õ@ ,õ
 ó Û Û Û ð ‡ƒ‰tÐ$Ó%Ô &÷ GÕ Fñ �˜}¨jð §¡õ ÷
 5Ó 4÷ "Ð !ß -Ð -à ‡�× Ò ˜(˜ 4Ð(©#Ô .Ø ‡�× Ò ˜(˜ 8Ð,©gÔ 6÷ /÷ -ñ
 -Ñ ÷ >Ð =ò �E×)Ò)Ô *Ù÷ +Ð *ñ —’×(Ò(�Ù—’×&Ò&�÷
 #÷÷ ÷ ð ÷ 6Ô 5÷V(ò V(ôr5Ñ&Bõ 5÷: %ò  %ñF �YÓ
�Ù�Ó�ð ð  %Ø$(Ø)ØØPTØ"ò	$Ø‘W™e�^Ñ$ð	$ð �}‰}ð	$ð �]‰]˜TÑ!ð		$ð
 �9‰_ð	$ð �‰*ð	$ñ �#�s˜XŸ\™\Ñ)¨H¯M©MÑ9¸IÑEÐEÑFÈÑMð	$ð �]‰]ð	$ð ‰w™ˆ~Ñô	$ó ñ	$ð àð	Lð  %Ø$(Ø)ØØPTØ"ò	LØð	Lð �}‰}ð	Lð �]‰]˜TÑ!ð		Lð
 �9‰_ð	Lð �‰*ð	Lñ �#�s˜XŸ\™\Ñ)¨H¯M©MÑ9¸IÑEÐEÑFÈÑMð	Lð �]‰]ð	Lð �	™'¡5˜.Ñ)Ð*¨I±g¹u°nÑ,EÐEÑFõ	Ló ñ	Lð /3ð@ð  %Ø$(Ø)ØØPTØ"ò@Ø‘W™e�^Ñ$ tÑ+ð@ð �}‰}ð@ð �]‰]˜TÑ!ð	@ð
 �9‰_ð@ð �‰*ð@ñ �#�s˜XŸ\™\Ñ)¨H¯M©MÑ9¸IÑEÐEÑFÈÑMð@ð �]‰]ð@ð ˆy™¡%˜Ñ(Ð)¨9±W¹e°^Ñ+DÐDÑEØ‘™�Ññ ÷@óF,÷(÷ ó ÷ KÔ Jß #Ð #ö ò ˆu�x‰x˜×&Ñ&ßOÓOá#ß)ð ˜RŸZšZÓ'ß(Ó(á×ÓÔ ô &ß ð ‡‚× Ò × Ò Ô ç &÷5ò 5ð  �~Š~×!Ò!×*Ò*Ø—’×#Ò#×,Ò,Ø—’×%Ò%×2Ò2Ø—.’.×'Ò'×4Ò4ñ	Ñ ö ÷÷ ô ò�MóOð& ‡‚ñ˜eŸlšl¨SÑ0°4Ñ7ô ó ñð4  $Ø#ñAà	�‰˜Ñ	ðAð 
�‰˜Ñ	öA÷4 ñ 	× Ó Ô óð.B¨X¯]©]õ Bó""ò& '×(Ñ(ÚÕð )øðwX ó 	Úð	ûðj ó 
Ý,à×%Ñ%Ñ-ÙØ�OŠOðó÷ ‰e‹gó
ð ð	ð  
ð)
ús   Â-q; Ér ñ;ròròAs
