Ë
    g^(h×@  ã                   ó†  — d dl Z d dlZd dlZd dlZd dlmZmZ d dlmZm	Z	m
Z
 d dlZd dlmc mZ d dlmZmZ d dlmZ d0d„Ze j*                   G d„ d«      «       Z G d	„ d
«      Zdedefd„Zdedeeef   fd„Zdedefd„Zdedefd„Zdedefd„Z dedefd„Z!dedefd„Z"defd„Z#d„ Z$dejJ                  deedf   de&eef   deeejN                  ef      fd„Z(d„ Z)dedefd„Z*defd „Z+d!„ Z,dejJ                  fd"„Z-dejJ                  fd#„Z.dejJ                  defd$„Z/dejJ                  de
edf   fd%„Z0	 d1dee   de&eef   d&edeejb                     fd'„Z2d(„ fd)„Z3 G d*„ d+«      Z4d,ejb                  dejb                  fd-„Z5dejl                  j&                  defd.„Z7dejJ                  dee8e   e8e   f   fd/„Z9y)2é    N)ÚIterableÚIterator)ÚAnyÚCallableÚUnion)Ú_CÚ_utils_internal)Ú
OpOverloadc                 ó<   — t        j                  dt        | ¬«       y )Nz}Python torch.library APIs do nothing under torch::deploy (multipy). Please instead use C++ custom operator registration APIs.©Ú
stacklevel)ÚwarningsÚwarnÚRuntimeWarningr   s    úR/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/torch/_library/utils.pyÚwarn_deployr      s   € Ü‡M�Mð	DäØö	ó    c                   ó,   — e Zd ZU dZeed<   eed<   d„ Zy)ÚKernelz$Models a (function, source location)ÚfuncÚsourcec                 ó&   —  | j                   |i |¤ŽS ©N)r   )ÚselfÚargsÚkwargss      r   Ú__call__zKernel.__call__   s   € Øˆt�y‰y˜$Ð) &Ñ)Ð)r   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Ú__annotations__Ústrr   © r   r   r   r      s   … á.à
ƒNØƒKó*r   r   c                   ó$   — e Zd ZdZdefd„Zdd„Zy)ÚRegistrationHandlez2Does something when someone calls .destroy() on itÚ
on_destroyc                 ó   — || _         y r   ©Ú_on_destroy)r   r'   s     r   Ú__init__zRegistrationHandle.__init__&   s
   € Ø%ˆÕr   Nc                 ó$   — | j                  «        y r   r)   )r   s    r   ÚdestroyzRegistrationHandle.destroy)   s   € Ø×ÑÕr   )ÚreturnN)r   r   r    r!   r   r+   r-   r$   r   r   r&   r&   #   s   „ Ù<ð& 8ó &ôr   r&   r   r.   c                 óŒ   — t        j                  t        j                  | «      «      }|j                  › d|j
                  › �}|S )zÃGet a string that represents the caller.

    Example: "/path/to/foo.py:42"

    Use stacklevel=1 to get the caller's source
    Use stacklevel=2 to get the caller's caller's source
    etc.
    ú:)ÚinspectÚgetframeinfoÚsysÚ	_getframeÚfilenameÚlineno)r   Úframer   s      r   Ú
get_sourcer8   -   s;   € ô × Ñ ¤§¡¨zÓ!:Ó;€EØ—‘Ð˜q §¡ Ð/€FØ€Mr   Úqualnamec                 ór   — | j                  d«      }t        |«      dk7  rt        d| › d�«      ‚|d   |d   fS )Nz::é   zAExpected `qualname` to be of the form "namespace::name", but got zf. The qualname passed to the torch.library APIs must consist of a namespace and a name, e.g. aten::sinr   é   )ÚsplitÚlenÚ
ValueError)r9   Úsplitss     r   Úparse_namespacerA   ;   sR   € Ø�^‰^˜DÓ!€FÜ
ˆ6ƒ{�aÒÜð*Ø*2¨ð 48ð9ó
ð 	
ð �!‰9�f˜Q‘iÐÐr   c                 ó¸   — t        | «      \  }}d|v r|j                  d«      \  }}nd}t        t        j                  |«      }t        ||«      }t        ||«      S )Nú.Údefault)rA   r=   ÚgetattrÚtorchÚops)r9   Ú	namespaceÚnameÚoverloadÚnsÚpackets         r   Ú	lookup_oprM   G   sV   € Ü% hÓ/�O€IˆtØ
ˆd�{ØŸ™ C›‰ˆ‰hàˆÜ	”—‘˜IÓ	&€BÜ�R˜Ó€FÜ�6˜8Ó$Ð$r   Úopc                 óB   — t        | t        «      sJ ‚| j                  dv S )N>   ÚatenÚprimÚprims)Ú
isinstancer
   rH   )rN   s    r   Ú
is_builtinrT   R   s"   € Ü�bœ*Ô%Ð%Ð%Ø�<‰<Ð4Ð4Ð4r   Úschemac                 óÚ   — d„ }t        | t        j                  j                  «      r || «      S ddlm} t        | t
        «      r|j                  | «      } t        | |«      sJ ‚ || «      S )zËCheck if the schema is functional.

    An operator is functional if:
    - it does not mutate any of its inputs
    - it does not return a view on any of its inputs
    - it has at least one return
    c                 óš   — | j                   ry| j                  }t        |«      dkD  xr t        d„ |D «       «      }|ry| j                  syy)NFr   c              3   ój   K  — | ]+  }|j                   d uxr |j                   j                   –— Œ- y ­wr   )Ú
alias_infoÚis_write)Ú.0Úrs     r   ú	<genexpr>z>is_functional_schema.<locals>.is_functional.<locals>.<genexpr>d   s3   è ø€ ò 5
ØGHˆA�L‰L Ð$ÒB¨Q¯\©\×-BÑ-BÐ)BÓBñ5
ùs   ‚13T)Ú
is_mutableÚreturnsr>   Úany)rU   ÚretsÚis_non_mutating_views      r   Úis_functionalz+is_functional_schema.<locals>.is_functional`   sS   € Ø×ÒØØ�~‰~ˆÜ" 4›y¨1™}ò  
´ñ 5
ØLPô5
ó 2
Ðñ  ØØ�~Š~ØØr   r   )ÚFunctionSchema)rS   rF   r   rd   Útorchgen.modelr#   Úparse)rU   rc   rd   s      r   Úis_functional_schemarg   W   sb   € òô �&œ%Ÿ(™(×1Ñ1Ô2Ù˜VÓ$Ð$õ .ä�&œ#ÔØ×%Ñ% fÓ-ˆÜ�f˜nÔ-Ð-Ð-Ù˜Ó Ð r   Útypc           	      óF  — | t        j                  t         j                  j                  «       «      k(  xsì | t        j                  t        j                  t         j                  j                  «       «      «      k(  xs£ | t        j                  t        j                  t         j                  j                  «       «      «      k(  xsZ | t        j                  t        j                  t        j                  t         j                  j                  «       «      «      «      k(  S r   )r   ÚListTypeÚ
TensorTypeÚgetÚOptionalType©rh   s    r   Úis_tensorlist_like_typero   z   s·   € àŒr�{‰{œ2Ÿ=™=×,Ñ,Ó.Ó/Ñ/ò 	UØ”"—+‘+œbŸo™o¬b¯m©m×.?Ñ.?Ó.AÓBÓCÑCò	Uà”"—/‘/¤"§+¡+¬b¯m©m×.?Ñ.?Ó.AÓ"BÓCÑCò	Uð ”"—/‘/¤"§+¡+¬b¯o©o¼b¿m¹m×>OÑ>OÓ>QÓ.RÓ"SÓTÑTð	r   c                 ó°   — | t         j                  j                  «       k(  xs4 | t        j                  t         j                  j                  «       «      k(  S r   )r   rk   rl   rm   rn   s    r   Úis_tensor_like_typerq   „   s:   € Ø”"—-‘-×#Ñ#Ó%Ñ%ÒT¨´·±ÄÇÁ×@QÑ@QÓ@SÓ0TÑ)TÐTr   c                 ó„  — | j                   dk7  ry| j                  }t        |j                  «      dk(  sy|j                  d   j                  €y|j                  d   j                  j
                  }t        |«      dk7  ryt        t        |«      «      }t        |j                  «      dk  ry|j                  d   }|j                  €y|j                  j                  sy|j                  j
                  }t        |«      dk7  ry|t        t        |«      «      k7  ry|j                  dd D ]  }|j                  €Œ y y)aN  Check if an op is an inplace aten op, i.e. it mutates and returns the first arg.

    TODO: torchgen/model.py's FunctionSchema.parse is the source of truth for this,
    but not all PyTorch builds have torchgen (due to the yaml dependency being weird).
    Figure this out.

    Example: add_(Tensor(a!) x, Tensor y) -> Tensor(a)
    rP   Fr<   r   NT)
rH   Ú_schemar>   r_   rY   Ú	after_setÚnextÚiterÚ	argumentsrZ   )rN   rU   Ú	alias_setÚlocÚ	first_argÚargs         r   Úmutates_and_returns_first_argr|   ˆ   s(  € ð 
‡|�|�vÒØØ�Z‰Z€FÜˆv�~‰~Ó !Ò#ØØ‡~�~�aÑ×#Ñ#Ð+ØØ—‘˜qÑ!×,Ñ,×6Ñ6€IÜ
ˆ9ƒ~˜ÒØÜ
Œt�I‹Ó
€CÜ
ˆ6×ÑÓ˜qÒ ØØ× Ñ  Ñ#€IØ×ÑÐ#ØØ×Ñ×(Ò(ØØ×$Ñ$×.Ñ.€IÜ
ˆ9ƒ~˜ÒØØ
Œd”4˜	“?Ó#Ò#ØØ×Ñ  Ð#ò ˆØ�>‰>Ñ%Ùðð r   c                 ó¦  — g }i }t        t        | j                  «      «      D ]   }| j                  |   }|j                  rE|j                  |v r||j                     ||j                  <   ŒI|j
                  ||j                  <   Œc|t        |«      k  r|j                  ||   «       Œ†|j                  |j
                  «       Œ¢ t        |«      |fS r   )Úranger>   rw   Ú
kwarg_onlyrI   Údefault_valueÚappendÚtuple)rU   r   r   Únew_argsÚ
new_kwargsÚiÚinfos          r   Úfill_defaultsr‡   ®   s·   € Ø€HØ€JÜ”3�v×'Ñ'Ó(Ó)ò 4ˆØ×Ñ Ñ"ˆØ�?Š?Ø�y‰y˜FÑ"Ø(.¨t¯y©yÑ(9�
˜4Ÿ9™9Ò%à(,×(:Ñ(:�
˜4Ÿ9™9Ò%à”3�t“9Š}Ø—‘  Q¡Õ(à—‘ × 2Ñ 2Õ3ð4ô �‹?˜JÐ&Ð&r   r   .r   c              #   ó´  K  — t        | j                  «      t        |«      t        |«      z   k\  sJ ‚t        t        | j                  «      «      D ]„  }| j                  |   }|j                  r"|j                  |v r|||j                     f–— Œ@|t        |«      k\  r.|j                  s!|j                  |v r|||j                     f–— Œ||||   f–— Œ† y­w)zÒzips schema.arguments and (args, kwargs) together.

    Assumes that (args, kwargs) were the inputs to some torch._ops.OpOverload:
    that is, (args, kwargs) must be bindable to the schema (args, kwargs).
    N)r>   rw   r~   r   rI   )rU   r   r   r…   r†   s        r   Ú
zip_schemar‰   À   sÐ   è ø€ ô ˆv×ÑÓ ¤C¨£I´°F³Ñ$;Ò;Ð;Ð;Ü”3�v×'Ñ'Ó(Ó)ò ˆØ×Ñ Ñ"ˆØ�?Š?Ø�y‰y˜FÑ"Ø˜F 4§9¡9Ñ-Ð-Ò-ØØ”�D“	Š>Ø—?’? t§y¡y°FÑ':Ø˜F 4§9¡9Ñ-Ð-Ò-ð Ø�D˜‘GˆmÓðð ùs   ‚CCc           	      ó\  — ddl m} | j                  }t        |t        j
                  j                  «      st        d«      ‚d„ }g }| j                  D ]×  }t        |t        j                  j                  t        j                  j                  j                  f«      r|j                   ||«      «       Œct        |t        j                  j                  j                  t        t         f«      r&|j                  |D �cg c]
  } ||«      ‘Œ c}«       ŒÂt        dt#        |«      › �«      ‚  t%        j&                  |j(                  «      j*                  |Ž } || «      }|j-                  |j.                  t!        |j0                  j3                  «       «      t        |«      f«      S c c}w )Nr   )ÚFunctionSchemaGenzfx_node's target must be a hop.c                 ó¸   — | j                   j                  dd «      }|€;| j                  dk(  sJ ‚t        | j                  j
                  | j                  «      }|S )NÚvalÚget_attr)Úmetarl   rN   rE   ÚgraphÚowning_moduleÚtarget)ÚnodeÚmeta_vals     r   Ú_collect_example_valz5hop_schema_from_fx_node.<locals>._collect_example_valá   sM   € Ø—9‘9—=‘= ¨Ó-ˆØÐØ—7‘7˜jÒ(Ð(Ð(Ü˜tŸz™z×7Ñ7¸¿¹ÓEˆHØˆr   zUnsupported arg type )Útorchgen.gen_schema_utilsr‹   r’   rS   rF   Ú_opsÚHigherOrderOperatorÚRuntimeErrorr   ÚfxÚNoder“   r�   Úimmutable_collectionsÚimmutable_listÚlistr‚   Útyper1   Ú	signaturer   ÚbindÚfrom_exampleÚ_namerw   Úitems)	r“   r‹   Úhopr•   Úexample_inputsr{   ÚxÚ
bound_argsÚexample_outputs	            r   Úhop_schema_from_fx_noderª   Ú   sW  € Ý;à
�+‰+€CÜ�cœ5Ÿ:™:×9Ñ9Ô:ÜÐ<Ó=Ð=òð €NØ�y‰yò DˆÜ�cœEŸH™HŸM™M¬5¯8©8¯=©=×+=Ñ+=Ð>Ô?Ø×!Ñ!Ñ"6°sÓ";Õ<ÜØ”%—(‘(×0Ñ0×?Ñ?ÄÄuÐMô
ð ×!Ñ!ÀCÖ"H¸qÑ#7¸Õ#:Ò"HÕIäÐ!6´t¸C³y°kÐBÓCÐCðDð *N¬×):Ñ):¸3¿<¹<Ó)H×)MÑ)MØ	ð*€Jñ *¨$Ó/€NØ×)Ñ)Ø�	‰	”5˜×-Ñ-×3Ñ3Ó5Ó6¼¸nÓ9MÐ8Oóð ùò #Is   Ã>F)
c                 ó¤   — t        | t        «      sJ ‚t        | «      ry| j                  }|j                  syt        |j                  «      dkD  ryy)NFr   T)rS   r
   rT   rs   r^   r>   r_   )rN   rU   s     r   Úcan_generate_trivial_fake_implr¬      sJ   € Ü�bœ*Ô%Ð%Ð%Ü�"„~ð Ø�Z‰Z€Fà×ÒØÜ
ˆ6�>‰>Ó˜QÒØàr   c                  ó$   — t        t        dd«      S )zðIf an op was defined in C++ and extended from Python using the
    torch.library APIs, returns if we require that there have been a
    m.set_python_module("mylib.ops") call from C++ that associates
    the C++ op with a python module.
    ÚREQUIRES_SET_PYTHON_MODULET)rE   r	   r$   r   r   Úrequires_set_python_moduler¯     s   € ô ”?Ð$@À$ÓGÐGr   c                 ó  — t        | t        j                  j                  j                  «      sJ ‚t        j                  j
                  j                  ||j                  «       f«      \  }}|D �cg c]w  }t        |t        j                  «      r[t        j                  j                  |«      j                  t        j                  j                  j                  «      rt        |«      ‘Œy }}| j                  ||||«      S c c}w r   )rS   rF   ÚutilsÚ_python_dispatchÚTorchDispatchModeÚ_pytreeÚtree_flattenÚvaluesÚTensorr   Ú_dispatch_keysÚhasÚDispatchKeyÚPythonrŸ   Ú__torch_dispatch__)Ú	curr_modeÚop_overloadr   r   Úargs_flattenedÚ_ÚaÚoverload_typess           r   Úhandle_dispatch_moderÃ     sÈ   € Ü�i¤§¡×!=Ñ!=×!OÑ!OÔPÐPÐPÜŸ™×+Ñ+×8Ñ8¸$ÀÇÁÃÐ9PÓQÑ€N�Að  öàÜ�aœŸ™Ô&Ü�H‰H×#Ñ# AÓ&×*Ñ*¬5¯8©8×+?Ñ+?×+FÑ+FÔGô 	ˆQ�ð€Nð ð ×'Ñ'¨°^ÀTÈ6ÓRÐRùòs   Á1A<Dc                 ó:   — t        d„ | j                  D «       «      S )Nc              3   ó4   K  — | ]  }|j                   –— Œ y ­wr   )r   ©r[   rÁ   s     r   r]   z&has_kwarg_only_args.<locals>.<genexpr>,  s   è ø€ Ò6 ˆq�|�|Ñ6ùs   ‚©r`   rw   ©rU   s    r   Úhas_kwarg_only_argsrÉ   +  s   € ÜÑ6 V×%5Ñ%5Ô6Ó6Ð6r   c                 ó˜   — | j                   D ];  }t        |j                  «      st        |j                  «      sŒ.|j                  sŒ; y y)NTF)rw   rq   rŸ   ro   r   )rU   rÁ   s     r   Úhas_kwarg_only_tensorsrË   /  sD   € Ø×Ñò ˆÜ# A§F¡FÔ+Ô/FÀqÇvÁvÔ/NØØ�|Š|ØÙðð r   c                 ó:   — t        d„ | j                  D «       «      S )z”
    Given a schema, returns True if the schema has a Tensor arg.
    A Tensor arg is any arg with a type annotation that might involve Tensor.
    c              3   ót   K  — | ]0  }t        |j                  «      xs t        |j                  «      –— Œ2 y ­wr   )rq   rŸ   ro   rÆ   s     r   r]   z!has_tensor_arg.<locals>.<genexpr>>  s3   è ø€ ò àô 
˜QŸV™VÓ	$Ò	GÔ(?ÀÇÁÓ(GÓ	Gñùs   ‚68rÇ   rÈ   s    r   Úhas_tensor_argrÎ   9  s$   € ô
 ñ à×!Ñ!ôó ð r   c                 óº   — t        | j                  «      D ]C  \  }}|j                  t        j                  j                  «       u sŒ1|j                  dk(  sŒA|c S  y)zx
    Given a schema, returns the id of the `device: torch.device` argument.
    If it does not exist, returns None.
    ÚdeviceN)Ú	enumeraterw   rŸ   r   ÚDeviceObjTyperl   rI   )rU   Úindexr{   s      r   Úget_device_arg_indexrÔ   D  sR   € ô
   × 0Ñ 0Ó1ò ‰
ˆˆsØ�8‰8”r×'Ñ'×+Ñ+Ó-Ò-°#·(±(¸hÓ2FØŠLðð r   Úallowed_nestingc              #   ó˜   ‡K  — ˆfd„}| D ]  } ||«      E d {  –—†  Œ |j                  «       D ]  } ||«      E d {  –—†  Œ y 7 Œ,7 Œ	­w)Nc              3   óÌ   •K  — t        | t        j                  «      r| –— y ‰dkD  r9t        | t        t        f«      r"t        t        | «      i ‰dz
  «      E d {  –—†  y y y 7 Œ­w)Nr   r<   )rS   rF   r·   r‚   rž   Úiter_tensors)r{   rÕ   s    €r   Úcheckziter_tensors.<locals>.checkR  sV   øè ø€ Ü�cœ5Ÿ<™<Ô(Ø‹IØ˜qÒ ¤Z°´e¼T°]Ô%CÜ#¤E¨#£J°°OÀaÑ4GÓH×HÑHð &DÐ ØHús   ƒAA$ÁA"ÁA$)r¶   )r   r   rÕ   rÙ   r{   Úkwargs     `   r   rØ   rØ   O  sV   øè ø€ ôIð ò ˆÙ˜“:×Ñðà—‘“ò  ˆÙ˜“<×Ññ ð 	øàús   ƒA
™Aš$A
¾A¿A
ÁA
c                   ó   — y)Nz???r$   r$   r   r   ú<lambda>rÜ   ^  s   � r   c                 ó’  — |D �ch c]6  }t        |t        j                  «      sŒt        |j	                  «       «      ’Œ8 }}|}t        |t
        «      s|f}t        |i «      D ]]  }t        |j	                  «       «      }t        |j	                  «       «      |v rt        | › d |«       › d�«      ‚|j                  |«       Œ_ yc c}w )zO
    custom operators' outputs must not alias any inputs or other outputs.
    z (with implementation in a™  ): The output of this custom operator (1) must not also be an input to this custom operator and (2) may not alias any inputs to this custom operator or other returns. The most common way to trigger this error is if we have y = custom_op(x) and y and x are the same Tensor. Please instead return a clone of the offending output tensor(s) (e.g. return x.clone()) or refactor the custom operator to not return y.N)	rS   rF   r·   ÚidÚuntyped_storager‚   rØ   r™   Úadd)	rI   ÚprevÚresultÚ
get_moduleÚtÚstoragesÚtuple_resultÚtensorÚkeys	            r   Úcheck_aliasing_constraintré   ^  sÁ   € ð 26ÖU¨A¼ÀAÄuÇ|Á|Õ9T”�1×$Ñ$Ó&Õ'ÐU€HÐUØ€LÜ�fœeÔ$Ø�yˆÜ˜|¨RÓ0ò ˆÜ�×'Ñ'Ó)Ó*ˆÜˆf×$Ñ$Ó&Ó'¨8Ñ3ÜØ�&Ð1±*³,°ð 	@,ð 	-óð ð 	�‰�SÕñùò	 Vs
   …C¥Cc                   ó   — e Zd ZdZd„ Zd„ Zy)ÚMutationCheckerz¥
    Check if an operator mutated its arguments.
    Usage:

    checker = MutationChecker(op, flat_args, args_spec)
    op(*args, **kwargs)
    checker.check()
    c                 ó¬   — || _         || _        || _        |D �cg c])  }t        |t        j
                  «      rt        |«      nd ‘Œ+ c}| _        y c c}w r   )rN   Ú	args_specÚ	flat_argsrS   rF   r·   Úhash_tensorÚreal_pre_hashes)r   rN   rî   rí   rÁ   s        r   r+   zMutationChecker.__init__‚  sJ   € ØˆŒØ"ˆŒØ"ˆŒàMVö 
ØHIœj¨¬E¯L©LÔ9ŒK˜ŒN¸tÑCò 
ˆÕùò  
s   š.Ac                 ó<  ‡ — ‰ j                   D �cg c])  }t        |t        j                  «      rt	        |«      nd ‘Œ+ }}t        ‰ j                  |«      D ��cg c]“  \  }}t        |t        j                  «      rrt        |t        j                  «      rXt        j                  ||«       xrA |j                  «       j                  «       xr |j                  «       j                  «        nd ‘Œ• }}}t        j                  |‰ j                  «      \  }}t        ‰ j                  j                  ||«      D ]W  \  }}ˆ fd„}	t!        |j"                  «      r
 |	||«       Œ*t%        |j"                  «      sŒ@|€dn
t'        |«      }
 |	||
«       ŒY y c c}w c c}}w )Nc           
      óÒ   •— | j                   |k(  ry t        ‰j                  j                  › d| j                  › d‰j                  j
                  › d| j                   rdnd› d�«      ‚)Nz: for argument 'z': the operator's schema z specified that the operator Úmutateszdoes not mutatea*   the argument, but this seems to be emperically wrong. Please make the schema and operator behavior consistent. You can specify that an operator mutates a Tensor by e.g. changing its schema type from 'Tensor name' to 'Tensor(a!) name'(use different identifiers (a, b, c, ...) for different Tensors))rZ   r™   rN   r£   rI   rs   )r†   Úwas_mutatedr   s     €r   Ú	check_onez(MutationChecker.check.<locals>.check_one�  si   ø€ Ø—=‘= KÒ/ØÜ"Ø—w‘w—}‘}�oÐ%5°d·i±i°[Ð@YØ—w‘w—‘Ð'ð ($Ø15·²¡IÐDUÐ#Vð WWðXó	ð 	r   F)rî   rS   rF   r·   rï   Úziprð   ÚequalÚisnanÚallÚpytreeÚtree_unflattenrí   r‰   rN   rs   rq   rŸ   ro   r`   )r   rÁ   Úreal_post_hashesÚpreÚpostrô   Úwas_mutated_argsÚwas_mutated_kwargsr†   rõ   Úwas_any_mutateds   `          r   rÙ   zMutationChecker.checkŠ  sk  ø€ ð —^‘^ö
àô )¨¬E¯L©LÔ9ŒK˜ŒN¸tÑCð
Ðð 
ô ! ×!5Ñ!5Ð7GÓH÷
ñ
 ��Tô ˜#œuŸ|™|Ô,´¸DÄ%Ç,Á,Ô1Oô —‘˜C Ó&Ð&ò ?Ø—Y‘Y“[—_‘_Ó&Ò=¨4¯:©:«<×+;Ñ+;Ó+=Ñ>àñð
ˆñ 
ô 06×/DÑ/DØ˜Ÿ™ó0
Ñ,ÐÐ,ô ",Ø�G‰G�O‰OÐ-Ð/Aó"
ò 	1ÑˆD�+ôô # 4§9¡9Ô-Ù˜$ Õ,Ü(¨¯©Õ3Ø+6Ð+>¡%ÄCÈÓDT�Ù˜$ Õ0ñ-	1ùò
ùó
s   �.FÁBFN)r   r   r    r!   r+   rÙ   r$   r   r   rë   rë   x  s   „ ñò
ó%1r   rë   rä   c                 óZ   — | j                  «       j                  «       j                  «       S )zNSome inexpensive hash. Used as a quick and dirty indicator for tensor mutation)ÚdetachÚfloatÚmean)rä   s    r   rï   rï   ²  s    € à�8‰8‹:×ÑÓ×"Ñ"Ó$Ð$r   c                 ó   — t        | «      ry| j                  }t        j                  j	                  |d«      ryt        j
                  j                  j                  |«      }|€�t        j                  j	                  |d«      ryt        j
                  j                  j                  j                  |«      }|j                  j                  �yt        j                  j	                  |d«      ryy|j                  �yy)z“If an operator (that stays alive until FakeTensorMode) has a Fake kernel.
    Don't use this if the operator decomposes before FakeTensorMode.
    TÚCompositeImplicitAutogradÚCompositeExplicitAutogradÚMetaF)r¬   r£   rF   r   Ú%_dispatch_has_kernel_for_dispatch_keyÚ_libraryÚ
custom_opsÚ_maybe_get_opdefÚsimple_registryÚ	singletonÚfindÚ	fake_implÚkernelÚ_abstract_fn)rN   rI   ÚopdefÚentrys       r   Úhas_fake_kernelr  ·  sÔ   € ô & bÔ)ØØ�8‰8€DÜ‡x�x×5Ñ5ØÐ)ôð Ü�N‰N×%Ñ%×6Ñ6°tÓ<€EØ€}ä�8‰8×9Ñ9ØÐ-ô
ð Ü—‘×.Ñ.×8Ñ8×=Ñ=¸dÓCˆØ�?‰?×!Ñ!Ð-ØÜ�8‰8×9Ñ9¸$ÀÔGØð
 ð ×ÑÐ)ØØr   c                 ó  — g }g }t        | j                  «      D ]b  \  }}|j                  €Œ|j                  j                  sŒ*|j                  r|j                  |j                  «       ŒR|j                  |«       Œd ||fS r   )rÑ   rw   rY   rZ   r   r�   rI   )rU   ÚidxsÚkeysr…   r†   s        r   Úmutated_args_kwargsr  Õ  sn   € Ø€DØ€DÜ˜V×-Ñ-Ó.ò ‰ˆˆ4Ø�?‰?Ñ&¨4¯?©?×+CÓ+CØ�ŠØ—‘˜DŸI™IÕ&à—‘˜A•ðð �ˆ:Ðr   )é   )r<   ):Údataclassesr1   r3   r   Úcollections.abcr   r   Útypingr   r   r   rF   Útorch.utils._pytreer±   r´   rú   r   r	   Ú
torch._opsr
   r   Ú	dataclassr   r&   Úintr#   r8   r‚   rA   rM   ÚboolrT   rg   ro   rq   r|   r‡   rd   ÚdictÚArgumentr‰   rª   r¬   r¯   rÃ   rÉ   rË   rÎ   rÔ   r·   rØ   ré   rë   rï   r—   r  rž   r  r$   r   r   ú<module>r&     sŽ  ðã Û Û 
Û ß .ß 'Ñ 'ã ß $Ð $ß %Ý !óð ×Ñ÷*ð *ó ð*÷ñ ð˜3ð  3ó ð	 ˜cð 	  e¨C°¨H¡oó 	 ð%˜ð % 
ó %ð5�:ð 5 $ó 5ð
! ð !¨ó !ðF ð ¨ó ðU˜Sð U Tó Uð# jó #òL'ð$Ø×ÑðØ%*¨3°¨8¡_ðØ>BÀ3ÈÀ8¹nðàˆe�B—K‘K Ð$Ñ%Ñ&óò4#ðL zð °dó ð H Dó HòSð$7 × 1Ñ 1ó 7ð 2×#4Ñ#4ó ð˜2×,Ñ,ð °ó ð ×!2Ñ!2ð °u¸SÀ$¸YÑ7Gó ð FGñ Ø
�‰*ð Ø" 3¨ 8™nð Ø?Bð àˆe�l‰lÑó ñ >Kó ÷471ñ 71ðt%�5—<‘<ð % E§L¡Ló %ð
˜Ÿ
™
×-Ñ-ð °$ó ð<	 × 1Ñ 1ð 	°e¸DÀ¹IÀtÈCÁyÐ<PÑ6Qô 	r   