ó
    
Eñi/
 ã                   ó¤  • % 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	J
r
JrJrJr  SSKJrJrJr  SSKJrJr  SSKrSSKJr  SSKJr  SSKJrJr  SSKJr  SS	KJr  SS
K J!r!J"r"  SSK#J$r$J%r%J&r&  SSK'J(r(J)r)J*r*J+r+  SSK,J-r-J.r.J/r/J0r0J1r1  SSK2J3r3J4r4J5r5  SSK6J7r7  SSK8J9r9J:r:J;r;  SSK<J=r=J>r>  SSK?J@r@  SSKAJBrB  \" S5      rC\%" 5       qD\"\RŠ                  RŒ                  lG        \!\RŠ                  R�                  lG        \RŠ                  R�                  rHS\Hl         S\HlI        S\HlJ        \@" \HS5        S rK\K\HlL        \-(       a  \Rš                  " SSS/5      rNOS rNS\Nl         S  rOS! rPS" rQ " S# S$5      rR " S% S&\R5      rS " S' S(\T5      rU " S) S*5      rV " S+ S,\W5      rXS- rY " S. S/5      rZS0\>S1\[S2\R¸                  Rn                  4S3 jr]\-(       Ga=  / S4Qr^ " S5 S65      r_\^ H  r`S7 ra\b" \_\`\a5        M      " S8 S9\7\US:9rc " S; S<\c5      rd\dRÊ                  RÍ                  5        HS  u  rgrh\i" \h5      (       d  \j" \h\k5      (       d  M#  \gRÙ                  S=5      (       d  \m" \c\g5      (       a  MI  \b" \c\g\h5        MU     S> rn1 S?kroS@ rp\n" \R¸                  Rn                  5       Hh  u  rgrq\gRÙ                  S=5      (       d  \gRå                  SA5      (       a  M4  \g\dRÊ                  ;  d  MF  \g\o;  d  MN  \b" \d\qR’                  \p" \g5      5        Mj     O4 " SB S65      r_ " SC S9\R¸                  Rn                  5      rc " SD S<\c5      rdSE rsSF rtSG ruSgSH jrvSIqw\x\ySJ'       ShSK\\z\{   \|\
\z\{   4   S4   4SL jjr}    ShSM\SNSSO\~SP\
\[/\4   S-  SK\\z\{   \|\
\z\{   4   S4   S2\4SQ jjrSR r€SS r�ST r‚SU rƒSM\CS2\C4SV jr„SW r…\RŠ                  GR                  r†\@" \†S5        SiSX\[SY\~SZ\~S[\[4S\ jjr‡ " S] S^5      rˆ " S_ S`5      r‰ " Sa Sb5      rŠSc r‹\" \‹Sd5        \" \GR                  Se5        \" \9Sf5        \" \:Sf5        \" \;Sf5        g)jzàTorchScript.

This module contains functionality to support the JIT's scripting frontend, notably:
    - torch.jit.script

This is not intended to be imported directly; please use the exposed
functionalities in `torch.jit`.
é    N)ÚCallableÚIteratorÚMappingÚSequence)ÚAnyÚTypeVarÚUnion)Ú
deprecatedÚSelf)Úclasses)Ú_get_model_idÚ_qualified_name)Úlog_torchscript_usage)Ú_register_builtin)Ú
_graph_forÚ_script_method_graph_for)ÚJitTypeTraceConfigÚJitTypeTraceStoreÚmonkeytype_trace)Ú_compile_and_register_classÚinfer_methods_to_compileÚScriptMethodStubÚwrap_cpp_module)Ú_enabledÚ_set_jit_function_cacheÚ_set_jit_overload_cacheÚ_try_get_jit_cached_functionÚ_try_get_jit_cached_overloads)Úget_default_argsÚget_jit_class_defÚget_jit_def)ÚModule)Úhas_torch_functionÚhas_torch_function_unaryÚhas_torch_function_variadic)ÚPackageExporterÚPackageImporter)Ú
set_moduleé   )Úvalidate_map_locationÚ_Tz†
Functionally equivalent to a :class:`ScriptModule`, but represents a single
function and does not have any attributes or Parameters.
ÚScriptFunctionútorch.jit.ScriptFunctionz	torch.jitc                 ó.   • [         R                  " S5      e)Nz ScriptFunction cannot be pickled©ÚpickleÚPickleError©Úclss    ÚN/home/mande/repo/quber/.venv/lib/python3.13/site-packages/torch/jit/_script.pyÚ_reducer5   O   s   € Ü
×
Ò
Ð?Ó
@Ð@ó    Ú	AttributeÚvalueÚtypec                 ó   • U $ ©N© )r8   r9   s     r4   r7   r7   Z   s   € Øˆr6   a¨  
    This method is a pass-through function that returns `value`, mostly
    used to indicate to the TorchScript compiler that the left-hand side
    expression is a class instance attribute with type of `type`. Note that
    `torch.jit.Attribute` should only be used in `__init__` method of `jit.ScriptModule`
    subclasses.

    Though TorchScript can infer correct type for most Python expressions, there are some cases where
    type inference can be wrong, including:

    - Empty containers like `[]` and `{}`, which TorchScript assumes to be container of `Tensor`
    - Optional types like `Optional[T]` but assigned a valid value of type `T`, TorchScript would assume
      it is type `T` rather than `Optional[T]`

    In eager mode, it is simply a pass-through function that returns `value`
    without other implications.

    Example:

    .. testcode::

        import torch
        from typing import Dict

        class AttributeModule(torch.jit.ScriptModule):
            def __init__(self) -> None:
                super().__init__()
                self.foo = torch.jit.Attribute(0.1, float)

                # we should be able to use self.foo as a float here
                assert 0.0 < self.foo

                self.names_ages = torch.jit.Attribute({}, Dict[str, int])
                self.names_ages["someone"] = 20
                assert isinstance(self.names_ages["someone"], int)

        m = AttributeModule()
        # m will contain two attributes
        # 1. foo of type float
        # 2. names_ages of type Dict[str, int]

    .. testcleanup::

        del AttributeModule
        del m

    Note: it's now preferred to instead use type annotations instead of `torch.jit.Attribute`:

    .. testcode::

        import torch
        from typing import Dict

        class AttributeModule(torch.nn.Module):
            names: Dict[str, int]

            def __init__(self) -> None:
                super().__init__()
                self.names = {}

        m = AttributeModule()

    .. testcleanup::

        del AttributeModule
        del m

    Args:
        value: An initial value to be assigned to attribute.
        type: A Python type

    Returns:
        Returns `value`
c                  ó   • [         $ r;   )Útype_trace_dbr<   r6   r4   Ú_get_type_trace_dbr?   ª   s   € äÐr6   c                 ó   • [        XS 5      $ r;   )Úgetattr)r3   Únames     r4   Ú_get_function_from_typerC   °   s   € Ü�3˜dÓ#Ð#r6   c                 óh   • [        U S5      (       a!  S[        U 5      ;   =(       d    [        U S5      $ g )NÚ	__class__Ú__dict__Ú	__slots__)ÚhasattrÚdirr2   s    r4   Ú_is_new_style_classrJ   ¶   s/   € Üˆs�K× Ñ ØœS ›XÑ%×B¬°°kÓ)BÐBð !r6   c                   óJ   • \ 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g)ÚOrderedDictWrapperéÊ   c                 ó   • Xl         g r;   ©Ú_c)ÚselfrP   s     r4   Ú__init__ÚOrderedDictWrapper.__init__Ë   s   € Ø�r6   c                 óX   • U R                  5        VVs/ s H  u  pUPM	     snn$ s  snnf r;   ©Úitems©rQ   ÚkÚvs      r4   ÚkeysÚOrderedDictWrapper.keysÎ   ó"   € Ø"Ÿj™jœlÔ+šl‘d�a“™lÒ+Ð+ùÓ+ó   ”&c                 óX   • U R                  5        VVs/ s H  u  pUPM	     snn$ s  snnf r;   rU   rW   s      r4   ÚvaluesÚOrderedDictWrapper.valuesÑ   r\   r]   c                 ó4   • [        U R                  5       5      $ r;   )Úlenr_   ©rQ   s    r4   Ú__len__ÚOrderedDictWrapper.__len__Ô   s   € Ü�4—;‘;“=Ó!Ð!r6   c                 ó   • [        S5      e)Nz6cannot delete methods or parameters of a script module©ÚRuntimeError©rQ   rX   s     r4   Ú__delitem__ÚOrderedDictWrapper.__delitem__×   s   € ÜÐSÓTÐTr6   c                 ó6   • U R                   R                  5       $ r;   )rP   rV   rc   s    r4   rV   ÚOrderedDictWrapper.itemsÚ   s   € Ø�w‰w�}‰}‹Ðr6   c                 ó`   • X;  a  [        SU 35      eU R                  R                  X5        g )NzICan't add a new parameter after ScriptModule construction. Tried to add ')rh   rP   ÚsetattrrW   s      r4   Ú__setitem__ÚOrderedDictWrapper.__setitem__Ý   s2   € Ø‹=ÜØ[Ð\]Ð[^Ð_óð ð 	�‰�‰˜Õr6   c                 ó8   • U R                   R                  U5      $ r;   )rP   Úcontainsri   s     r4   Ú__contains__ÚOrderedDictWrapper.__contains__ä   s   € Ø�w‰w×Ñ Ó"Ð"r6   c                 óX   • X;  a  [        U5      eU R                  R                  U5      $ r;   )ÚKeyErrorrP   rA   ri   s     r4   Ú__getitem__ÚOrderedDictWrapper.__getitem__ç   s$   € Ø‹=Ü˜1“+ÐØ�w‰w�‰˜qÓ!Ð!r6   rO   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__rR   rZ   r_   rd   rj   rV   rp   rt   rx   Ú__static_attributes__r<   r6   r4   rL   rL   Ê   s0   † òò,ò,ò"òUòòò#õ"r6   rL   c                   ó@   ^ • \ rS rSrU 4S jrS rS rS rS rSr	U =r
$ )ÚOrderedModuleDictéí   c                 ój   >• [         TU ]  [        R                  R	                  U5      5        X l        g r;   )ÚsuperrR   ÚtorchÚ_CÚ
ModuleDictÚ_python_modules)rQ   ÚmoduleÚpython_dictrE   s      €r4   rR   ÚOrderedModuleDict.__init__î   s'   ø€ Ü‰ÑœŸ™×,Ñ,¨VÓ4Ô5ð  +Õr6   c                 ó:   • U R                   R                  5       nU$ r;   )r‡   rV   ©rQ   Úrs     r4   rV   ÚOrderedModuleDict.itemsø   s   € Ø× Ñ ×&Ñ&Ó(ˆØˆr6   c                 ó   • XR                   ;   $ r;   ©r‡   ri   s     r4   rt   ÚOrderedModuleDict.__contains__ü   s   € Ø×(Ñ(Ñ(Ð(r6   c                 ó¢   • [        U[        5      (       a*  U R                  R                  X5        X R                  U'   g [        SU SU 35      e)NzgCannot re-assign modules in a ScriptModule with non-scripted module, tried to replace existing module 'z': )Ú
isinstanceÚScriptModulerP   ro   r‡   rh   rW   s      r4   rp   ÚOrderedModuleDict.__setitem__ÿ   sR   € ô �aœ×&Ñ&Ø�G‰G�O‰O˜AÔ!Ø&'× Ñ  Ò#äð=Ø=>¸C¸sÀ1À#ðGóð r6   c                 ó    • U R                   U   $ r;   r�   ri   s     r4   rx   ÚOrderedModuleDict.__getitem__  s   € Ø×#Ñ# AÑ&Ð&r6   r�   )rz   r{   r|   r}   rR   rV   rt   rp   rx   r~   Ú__classcell__©rE   s   @r4   r€   r€   í   s!   ø† õ+òò)ò÷&'ð 'r6   r€   c                   ó(   ^ • \ rS rSrU 4S jrSrU =r$ )Ú
ScriptMetai  c                 óâ  >^ ^	• 0 T l         [        [        T SS5      5      T l        [	        U5       Hk  n[        US0 5      R                  5        H  u  pVUT R                   U'   M     [        US[        5       5      nT R                  R                  U5      T l        Mm     [        UR                  5       5       HK  u  pV[        U[        5      (       d  M  [        T U5        UT R                   UR                  R                  '   MM     [        T SS5      (       a  [        T
T ]9  XU5        g [        T SS 5      m	[        R                   " T	5      U U	4S	 j5       nUT l        [        T
T ]9  XU5        g )
NÚ__constants__r<   Ú_methodsÚ_constants_setÚ_disable_script_metaFrR   c                 ó   • g r;   r<   rc   s    r4   Ú<lambda>Ú%ScriptMeta.__init__.<locals>.<lambda>6  s   € ¸dr6   c                 óð  >• [        T	R                  5      nT
" U /UQ70 UD6  [        T	R                  5      U:„  n[        U 5      T	L a®  S n[        R                  R
                  R                  XU(       + S9U R                  S'   U R                  R                  nUR                  5        H  n[        X5        M     UR                  5        H  u  px[        X5        M     S H  n[        X5        M     g g )Nc                 óÌ   • [        U 5      n[        US5      (       a8  [        UR                  R	                  5       5       VVs/ s H  u  p#UPM	     snn$ [        U 5      $ s  snnf )Nrž   )r9   rH   Úsortedrž   rV   r   )rˆ   r3   rX   rY   s       r4   Ú
make_stubsÚAScriptMeta.__init__.<locals>.init_then_script.<locals>.make_stubs@  sT   € Ü˜v›,�CÜ˜s J×/Ñ/Ü.4°S·\±\×5GÑ5GÓ5IÔ.JÔKÒ.J¡d a£Ñ.JÒKÐKä7¸Ó?Ð?ùó  Ls   ÁA )Úshare_typesÚ_actual_script_module)Ú_parametersÚ_buffersÚ_modules)rb   rž   r9   r„   ÚjitÚ
_recursiveÚcreate_script_modulerF   rª   Ú_concrete_typeÚget_attributesÚdelattrÚget_modules)rQ   ÚargsÚkwargsÚnum_methodsÚadded_methods_in_initr§   Úconcrete_typerB   Ú_r3   Úoriginal_inits            €€r4   Úinit_then_scriptÚ-ScriptMeta.__init__.<locals>.init_then_script8  sã   ø€ ä˜cŸl™lÓ+ˆKÙ˜$Ð0 Ò0¨Ò0Ü$'¨¯©Ó$5¸Ñ$CÐ!ä�D‹z˜SÒ ò@ô —I‘I×(Ñ(×=Ñ=ØÐ:OÔ6Oð >ð ð —‘Ð5Ñ6ð !%× :Ñ :× IÑ I�Ø)×8Ñ8Ö:�DÜ˜DÖ'ñ ;à,×8Ñ8Ö:‘G�DÜ˜DÖ'ñ  ;ãC�DÜ˜DÖ'ò Dð/ !r6   )rž   ÚsetrA   rŸ   ÚreversedrV   Úunionr¦   r“   r   r³   Úoriginal_methodrz   rƒ   rR   Ú	functoolsÚwraps)r3   rB   ÚbasesÚattrsÚbaserX   rY   Úbase_constantsr¼   r»   rE   s   `        @€r4   rR   ÚScriptMeta.__init__  s5  ú€ à')ˆŒÜ ¤¨¨o¸rÓ!BÓCˆÔÜ˜U–OˆDÜ  j°"Ó5×;Ñ;Ö=‘�Ø"#�—‘˜Q“ñ >ä")¨$Ð0@Ä#Ã%Ó"HˆNØ!$×!3Ñ!3×!9Ñ!9¸.Ó!IˆCÖñ	 $ô ˜5Ÿ;™;›=Ö)‰DˆAÜ˜!Ô-×.Ó.Ü˜˜Q”Ø;<�—‘˜Q×.Ñ.×7Ñ7Ó8ñ *ô
 �3Ð.°×6Ñ6ô ‰GÑ˜T¨%Ô0Øä  ZÑ1BÓCˆä	�Š˜Ó	'õ	(ó 
(ð	(ð> (ˆŒÜ‰Ñ˜ eÕ,r6   r<   ©rz   r{   r|   r}   rR   r~   r˜   r™   s   @r4   r›   r›     s   ø† ÷:-ó :-r6   r›   c                   ó   • \ rS rSrS rSrg)Ú_CachedForwardi\  c                 ó$   • U R                  S5      $ )NÚforward)Ú__getattr__)rQ   Úobjr3   s      r4   Ú__get__Ú_CachedForward.__get__]  s   € Ø×Ñ 	Ó*Ð*r6   r<   N)rz   r{   r|   r}   rÐ   r~   r<   r6   r4   rË   rË   \  s   † õ+r6   rË   c                   ó   • \ rS rSrSrg)ÚScriptWarningia  r<   N©rz   r{   r|   r}   r~   r<   r6   r4   rÓ   rÓ   a  s   † Úr6   rÓ   c                 ó  • [         R                  S:¼  a  [        R                  " S[        5        O[        R                  " S[        5        [
        (       d  U $ [        R                  " SS9n[        X R                  SS9n[        XU 5      $ )N©é   é   z}`torch.jit.script_method` is not supported in Python 3.14+ and may break. Please switch to `torch.compile` or `torch.export`.z\`torch.jit.script_method` is deprecated. Please switch to `torch.compile` or `torch.export`.é   ©Ú	frames_upr”   )Ú	self_name)ÚsysÚversion_infoÚwarningsÚwarnÚDeprecationWarningr   Ú_jit_internalÚ!createResolutionCallbackFromFramer!   rz   r   )ÚfnÚ_rcbÚasts      r4   Úscript_methodrç   e  st   € Ü
×Ñ˜7Ó"Ü�ŠðBäõ	
ô 	�ŠØjÜô	
÷ Š8Øˆ	ô ×:Ò:ÀQÑG€DÜ
�bŸ+™+°Ñ
@€CÜ˜D rÓ*Ð*r6   c                   óB   • \ rS rSrS\\\4   SS4S jrS\S\4S jrSr	g)	ÚConstMapi„  Úconst_mappingÚreturnNc                 ó   • Xl         g r;   ©rê   )rQ   rê   s     r4   rR   ÚConstMap.__init__…  s   € Ø*Õr6   Úattrc                 ó    • U R                   U   $ r;   rí   )rQ   rï   s     r4   rÎ   ÚConstMap.__getattr__ˆ  s   € Ø×!Ñ! $Ñ'Ð'r6   rí   )
rz   r{   r|   r}   r   Ústrr   rR   rÎ   r~   r<   r6   r4   ré   ré   „  s1   † ð+ g¨c°3¨hÑ&7ð +¸Dô +ð( ð (¨÷ (r6   ré   ÚimporterÚscript_module_idrë   c                 ód  • [        U R                  [        R                  R                  5      (       d  [        S5      e[        R                  R                  5       n[        R                  R                  UU R                  U R                  [        U R                  5      U5      n[        U5      $ )z®
Call by ``torch.package.PackageImporter``'s Pickler's ``persistent_load`` function.

Performs work of loading and returning a ScriptModule from a ``torch.package`` archive.
z{Loading ScriptObjects from a PackageImporter created from a directory is not supported. Use a package archive file instead.)r“   Ú
zip_readerr„   r…   ÚPyTorchFileReaderrh   ÚCompilationUnitÚ_import_ir_module_from_packageÚstorage_contextr*   Úlast_map_locationr   )ró   rô   ÚcuÚ
cpp_modules       r4   Úunpackage_script_modulerþ   Œ  s�   € ô �h×)Ñ)¬5¯8©8×+EÑ+E×FÑFÜðNó
ð 	
ô 
�‰×	!Ñ	!Ó	#€BÜ—‘×8Ñ8Ø
Ø×ÑØ× Ñ Ü˜h×8Ñ8Ó9Øó€Jô ˜:Ó&Ð&r6   )Ú__iter__rd   Ú__neg__Ú__mul__rt   Ú__add__Ú__sub__Ú__pow__Ú__truediv__Ú__mod__Ú__ne__Ú__eq__Ú__lt__Ú__gt__Ú__le__Ú__ge__Ú__and__Ú__or__Ú__xor__rx   rp   Ú__call__Ú__int__Ú	__float__Ú__bool__Ú__str__Ú	__enter__Ú__exit__c                   ó’   ^ • \ rS rSrSrU 4S jrS\S\4U 4S jjrS\S\SS4U 4S	 jjr	S
\S\S\S\4S jr
S rS\S\4S jrSrU =r$ )ÚRecursiveScriptClassiÄ  a  Wrapper for a TorchScript class instance for use in Python.

An analogue of RecursiveScriptModule for regular objects that are not modules.
This class is a wrapper around a torch._C.ScriptObject that represents an instance
of a TorchScript class and allows it to be used in Python.

Attributes:
    _c [torch._C.ScriptObject]: The C++ object to which attribute lookups and method
        calls are forwarded.
    _props [Dict[str, property]]: A dictionary of properties fetched from self._c and
        exposed on this wrppaer.
c                 ó&  >• [         TU ]  5         SU R                  S'   Xl        U R                  R	                  5        Vs0 s H.  nUR
                  [        UR                  UR                  5      _M0     snU l	        SU R                  S'   g s  snf )NTÚ_initializingF)
rƒ   rR   rF   rP   Ú_propertiesrB   ÚpropertyÚgetterÚsetterÚ_props)rQ   Ú	cpp_classÚproprE   s      €r4   rR   ÚRecursiveScriptClass.__init__Ò  s|   ø€ Ü‰GÑÔØ-1ˆD�M‰M˜/Ñ*ØŒGð
 !ŸG™G×/Ñ/Ô1óâ1�Dð —	‘	œ8 D§K¡K°·±Ó=Ò=Ù1ñˆDŒKð
 .3ˆD�M‰M˜/Ò*ùòs   Á5Brï   rë   c                 óæ   >• U R                   R                  S5      (       a  [        TU ]  U5      $ XR                  ;   a  U R                  U   R                  5       $ [        U R                  U5      $ ©Nr  )rF   Úgetrƒ   rÎ   r  ÚfgetrA   rP   ©rQ   rï   rE   s     €r4   rÎ   Ú RecursiveScriptClass.__getattr__ß  s[   ø€ Ø�}‰}× Ñ  ×1Ñ1Ü‘wÑ*¨4Ó0Ð0à—{‘{Ó"Ø—{‘{ 4Ñ(×-Ñ-Ó/Ð/ä˜4Ÿ7™7 DÓ)Ð)r6   r8   Nc                 óê   >• U R                   R                  S5      (       a  [        TU ]  X5      $ XR                  ;   a  U R                  U   R                  U5      $ [        U R                  X5        g r$  )rF   r%  rƒ   Ú__setattr__r  Úfsetro   rP   ©rQ   rï   r8   rE   s      €r4   r*  Ú RecursiveScriptClass.__setattr__è  sZ   ø€ Ø�}‰}× Ñ  ×1Ñ1Ü‘wÑ*¨4Ó7Ð7à—{‘{Ó"Ø—{‘{ 4Ñ(×-Ñ-¨eÓ4Ð4ä�D—G‘G˜TÕ)r6   Úmethod_namerµ   r¶   c                 ó€   • U R                   R                  U5      (       d  [        eU R                  U5      nU" U0 UD6$ r;   )rP   Ú_has_methodÚ	TypeErrorrÎ   ©rQ   r.  rµ   r¶   Úself_methods        r4   Úforward_magic_methodÚ)RecursiveScriptClass.forward_magic_methodó  s>   € ð —7‘7×&Ñ& {×3Ñ3Ü�à×*Ñ*¨;Ó7ˆKÙ Ð/¨Ñ/Ð/r6   c                 ó.   • [         R                  " S5      e)NzScriptClasses cannot be pickledr/   rc   s    r4   Ú__getstate__Ú!RecursiveScriptClass.__getstate__ü  s   € Ü×$Ò$Ð%FÓGÐGr6   Úotherc                 óŠ   • U R                   R                  S5      (       a  U R                  SU5      $ U R                  SU5      $ )NÚ__iadd__r  )rP   r0  r4  )rQ   r9  s     r4   r;  ÚRecursiveScriptClass.__iadd__ÿ  s=   € Ø�w‰w×"Ñ" :×.Ñ.Ø×0Ñ0°¸UÓCÐCà×0Ñ0°¸EÓBÐBr6   )rP   r  )rz   r{   r|   r}   Ú__doc__rR   rò   r   rÎ   r*  r4  r7  r   r;  r~   r˜   r™   s   @r4   r  r  Ä  s�   ø† ñ	õ	3ð	* Cð 	*¨C÷ 	*ð	* Cð 	*°ð 	*¸÷ 	*ð	0Ø"ð	0Ø+.ð	0Ø:=ð	0àô	0ò	Hð	C $ð 	C¨4÷ 	Cò 	Cr6   r  c                 ó6   • U R                   " [        /UQ70 UD6$ r;   )r4  r.  ©rQ   rµ   r¶   s      r4   Úmethod_templater@    s   € Ø×,Ò,¬[ÐJ¸4ÒJÀ6ÑJÐJr6   c                   óª   ^ • \ rS rSr% Sr/ SQrSU 4S jjr\" 5       r\	S\
4   \S'   S	\S\
4U 4S
 jjrS	\S\
SS4U 4S jjrS rS rS\4S jrSrU =r$ )r”   i  a  Wrapper for C++ torch::jit::Module with methods, attributes, and parameters.

A wrapper around C++ ``torch::jit::Module``. ``ScriptModule``\s
contain methods, attributes, parameters, and
constants. These can be accessed the same way as on a normal ``nn.Module``.
)ÚcodeÚcode_with_constantsÚgraphÚinlined_graphÚoriginal_namerë   Nc                 ó"   >• [         TU ]  5         g r;   ©rƒ   rR   )rQ   rE   s    €r4   rR   ÚScriptModule.__init__$  ó   ø€ Ü‰GÑÕr6   .rÍ   rï   c                 ón   >• SU R                   ;  a  [        TU ]	  U5      $ [        U R                  U5      $ )Nrª   )rF   rƒ   rÎ   rA   rª   r'  s     €r4   rÎ   ÚScriptModule.__getattr__)  s2   ø€ Ø&¨d¯m©mÓ;Ü‘wÑ*¨4Ó0Ð0Ü˜4×5Ñ5°tÓ<Ð<r6   r8   c                 ó:  >• SU R                   ;  at  [        U[        5      (       aP  SU R                  R                   ;  a  0 U R                  l        UR
                  U R                  U'   UR                  n[        TU ]!  X5      $ [        U R                  X5        g )Nrª   Ú__annotations__)rF   r“   r7   rE   rN  r9   r8   rƒ   r*  ro   rª   r,  s      €r4   r*  ÚScriptModule.__setattr__.  s{   ø€ Ø&¨d¯m©mÓ;ô ˜e¤Y×/Ñ/ð
 )°·±×0GÑ0GÓGØ9;˜Ÿ™Ô6Ø16·±�D×(Ñ(¨Ñ.Ø!ŸK™K�EÜ‘wÑ*¨4Ó7Ð7ä�D×.Ñ.°Õ<r6   c                 ó"  • SU R                   ;   a  U R                  R                  U5      $ [        R                  " SS9n[
        R                  R                  U5      n[        X#S 5      U R                  UR                  5       R                  '   g )Nrª   r)   rÚ   )rF   rª   Údefinerâ   rã   r„   r…   Ú_parse_source_defr   rž   rB   )rQ   ÚsrcÚrcbræ   s       r4   rQ  ÚScriptModule.defineC  sl   € Ø&¨$¯-©-Ó7ð ×1Ñ1×8Ñ8¸Ó=Ð=ô  ×AÒAÈAÑNˆCÜ—(‘(×,Ñ,¨SÓ1ˆCÜ-=¸cÈÓ-MˆD�M‰M˜#Ÿ(™(›*Ÿ/™/Ò*r6   c                 ó6   • U R                   R                  5       $ r;   )rª   Ú_replicate_for_data_parallelrc   s    r4   rW  Ú)ScriptModule._replicate_for_data_parallelY  s   € Ø×-Ñ-×JÑJÓLÐLr6   Úexporterc                 ó’   • UR                  5       nUR                  R                  U R                  [	        U5      5        [
        U44$ )ap  Save a ScriptModule inside of a ``torch.package`` archive.

Called by ``torch.package.PackageExporter``'s Pickler's ``persistent_id`` when
saving TorchScript objects. Performs act of saving a ScriptModule inside of
a ``torch.package`` archive.

Returns method to load the ScriptModule from a ``torch.package.PackageImporter``'s
Pickler's ``persistent_load`` function.
)Úget_unique_idÚscript_module_serializerÚ	serializerP   Úintrþ   )rQ   rY  rô   s      r4   Ú__reduce_package__ÚScriptModule.__reduce_package__\  sB   € ð  (×5Ñ5Ó7ÐØ×-Ñ-×7Ñ7¸¿¹ÄÐEUÓAVÔWÜ+Ð.>Ð-@ÐAÐAr6   r<   ©rë   N)rz   r{   r|   r}   r=  Ú__jit_unused_properties__rR   rË   rÍ   r   r   rN  rò   rÎ   r*  rQ  rW  r&   r_  r~   r˜   r™   s   @r4   r”   r”     sz   ø‡ ñ	ò%
Ð!÷	ñ '5Ó&6ˆ�˜#˜s˜(Ñ#Ó6ð	= Cð 	=¨C÷ 	=ð
	= Cð 	=°ð 	=¸÷ 	=ò*	Nò,	Mð	B¨÷ 	Bò 	Br6   r”   )Ú	metaclassc                   ó  ^ • \ rS rSrSrSrU 4S jr\S 5       r\S 5       r	S r
\S 5       r\S	 5       r\S
 5       r\S 5       rS r\" S5      S 5       r\" S5      S 5       rS\S\S\4S jrS\S\S\4S jrS\4S jrS\S\S\4S jr\S 5       rS rS\S\4U 4S jjrS\S\SS4U 4S jjrS\4S jrS\ \!\4   S-  S\4S  jr"S!\S\S\S\4S" jr#S\$\   4S# jr%S$\!S\4S% jr&S& r'S' r(S\)\   4U 4S( jjr*S) r+S* r,S+r-U =r.$ ),ÚRecursiveScriptModuleij  aÊ  Retain the existing isinstance(ScriptModule) behavior.

The core data structure in TorchScript is the ``ScriptModule``. It is an
analogue of torch's ``nn.Module`` and represents an entire model as a tree of
submodules. Like normal modules, each individual module in a ``ScriptModule`` can
have submodules, parameters, and methods. In ``nn.Module``\s methods are implemented
as Python functions, but in ``ScriptModule``\s methods are implemented as
TorchScript functions, a statically-typed subset of Python that contains all
of PyTorch's built-in Tensor operations. This difference allows your
``ScriptModule``\s code to run without the need for a Python interpreter.

``ScriptModule``\s should not be created manually, instead use
either :func:`tracing <torch.jit.trace>` or :func:`scripting <torch.jit.script>`.
Tracing and scripting can be applied incrementally and :ref:`composed as necessary <Types>`.

* Tracing records the tensor operations as executed with a set of example inputs and uses these
  operations to construct a computation graph. You can use the full dynamic behavior of Python with tracing,
  but values other than Tensors and control flow aren't captured in the graph.

* Scripting inspects the Python code of the model
  and compiles it to TorchScript. Scripting allows the use of many `types`_ of values and supports dynamic control flow.
  Many, but not all features of Python are supported by the compiler, so changes to the source code may be necessary.
Tc                 ód   >• SU R                   S'   Xl        [        TU ]  5         [	        U S5        g )NTr  Útraining)rF   rP   rƒ   rR   r³   )rQ   rý   rE   s     €r4   rR   ÚRecursiveScriptModule.__init__ˆ  s-   ø€ Ø-1ˆD�M‰M˜/Ñ*Ø ŒGÜ‰GÑÔô �D˜*Õ%r6   c                 óV   • [        U 5      nU" U5        [         R                  U5        U$ )a  
Construct a RecursiveScriptModule that's ready for use.

PyTorch code should use this to construct a RecursiveScriptModule instead
of instead of calling `__init__` directly, as it makes sure the
object is properly finalized (and in the future, we may take
control of how the RecursiveScriptModule instance is created).

Args:
    cpp_module:  The C++ Module that will hold the actual state of
                 this RecursiveScriptModule instance.
    init_fn:  Lambda that initializes the RecursiveScriptModule passed to it.
)re  Ú_finalize_scriptmodule)rý   Úinit_fnÚscript_modules      r4   Ú
_constructÚ RecursiveScriptModule._construct‘  s,   € ô 2°*Ó=ˆMÙ�MÔ"ô
 "×8Ñ8¸ÔGØ Ð r6   c                 ó8  • [        [        R                  R                  U R                  5      5      U l        [        [        R                  R                  U R                  5      5      U l        [        U R                  U R                  5      U l	        SU l
        g )NF)rL   r„   r…   ÚParameterDictrP   r«   Ú
BufferDictr¬   r€   r­   r  ©rl  s    r4   rj  Ú,RecursiveScriptModule._finalize_scriptmodule©  sx   € ä(:Ü—‘×&Ñ& }×'7Ñ'7Ó8ó)ˆMÔ%ô &8Ü—‘×#Ñ# M×$4Ñ$4Ó5ó&ˆMÔ"ô &7Ø× Ñ  -×"8Ñ"8ó&ˆMÔ"ð +0ˆMÕ'r6   c                 óJ  • U R                  U5        [        R                  R                  R	                  U R
                  R                  5       5      U l        0 n[        R                  R                  U R
                  5      R                  5        H  u  p1[        U5      X#'   M     [        U R
                  U5      U l        [        [        R                  R                  U R
                  5      5      U l        [        [        R                  R!                  U R
                  5      5      U l        U R$                  R                  5        VVs0 s H2  u  pE['        U[        R                  R(                  5      (       a  M0  XE_M4     snnU l        SU R$                  S'   gs  snnf )z´
Re-construct an instance of RecursiveScriptModule using an instance of a C++ module.

Args:
    cpp_module: The C++ module that this RecursiveScriptModule will be rebuilt around.
Fr  N)rR   r„   r…   ÚConcreteModuleTypeÚfrom_jit_typerP   Ú_typer±   r†   rV   r   r€   r­   rL   rp  r«   rq  r¬   rF   r“   ÚScriptMethod)rQ   rý   ÚmodulesrB   rX   rY   s         r4   Ú_reconstructÚ"RecursiveScriptModule._reconstruct¶  s)  € ð �M‰M˜*Ô%ô #(§(¡(×"=Ñ"=×"KÑ"KØ—‘—‘“ó#ˆDÔð
 ˆGÜ$)§H¡H×$7Ñ$7¸¿¹Ó$@×$FÑ$FÖ$HÑ �Ü /°
Ó ;�“ñ %Iä-¨d¯g©g°wÓ?ˆDŒMô  2´%·(±(×2HÑ2HÈÏÉÓ2QÓRˆDÔÜ.¬u¯x©x×/BÑ/BÀ4Ç7Á7Ó/KÓLˆDŒMð
 !ŸM™M×/Ñ/Ô1ôâ1‘D�AÜ! !¤U§X¡X×%:Ñ%:×;ó �’Ù1òˆDŒMð
 .3ˆD�M‰M˜/Ò*ùós   Å/FÆ Fc                 óL   • U R                   R                  S5      R                  $ )zPReturn a string representation of the internal graph for the ``forward`` method.rÍ   )rP   Ú_get_methodrD  rc   s    r4   rD  ÚRecursiveScriptModule.graphÖ  s   € ð —7‘7×&Ñ& yÓ1×7Ñ7Ð7r6   c                 ó.   • U R                   R                  $ )zœ
Return a string representation of the internal graph for the ``forward`` method.

This graph will be preprocessed to inline all function and method calls.
)rÍ   rE  rc   s    r4   rE  Ú#RecursiveScriptModule.inlined_graphÛ  s   € ð —<‘<×-Ñ-Ð-r6   c                 ó.   • U R                   R                  $ )zt
Return a pretty-printed representation (as valid Python syntax) of the internal graph for the ``forward`` method.

)rÍ   rB  rc   s    r4   rB  ÚRecursiveScriptModule.codeä  s   € ð —<‘<×$Ñ$Ð$r6   c                 óT   • U R                   R                  nUS   [        US   5      4$ )a4  Return a tuple.

Returns a tuple of:

[0] a pretty-printed representation (as valid Python syntax) of
the internal graph for the ``forward`` method. See `code`.
[1] a ConstMap following the CONSTANT.cN format of the output in [0].
The indices in the [0] output are keys to the underlying constant's values.

r   r)   )rÍ   rC  ré   rŒ   s     r4   rC  Ú)RecursiveScriptModule.code_with_constantsì  s*   € ð —‘×0Ñ0ˆAØ�a‘Dœ( 1 Q¡4›.Ð)Ð)r6   c                 óN   • U R                   R                  " [        U5      40 UD6$ )a1  Save with a file-like object.

save(f, _extra_files={})

See :func:`torch.jit.save <torch.jit.save>` which accepts a file-like object.
This function, torch.save(), converts the object to a string, treating it as a path.
DO NOT confuse these two functions when it comes to the 'f' parameter functionality.
)rP   Úsaverò   )rQ   Úfr¶   s      r4   r†  ÚRecursiveScriptModule.saveû  s    € ð —7‘7—<’<¤ A£Ñ1¨&Ñ1Ð1r6   z”Lite Interpreter is deprecated. Please consider switching to ExecuTorch.             https://docs.pytorch.org/executorch/stable/getting-started.htmlc                 ón   • [         R                  " S[        SS9  U R                  R                  " U0 UD6$ )a&  Add (or update) the bytecode session to the script model.

_save_for_lite_interpreter(f)

The updated model is used
in lite interpreter for mobile applications.

Args:
    f: a string containing a file name.
    _extra_files: Map from filename to contents which will be stored as part of 'f'.

ú˜Lite Interpreter is deprecated. Please consider switching to ExecuTorch.                 https://docs.pytorch.org/executorch/stable/getting-started.htmlrÙ   ©Ú
stacklevel)rß   rà   rá   rP   Ú_save_for_mobiler?  s      r4   Ú_save_for_lite_interpreterÚ0RecursiveScriptModule._save_for_lite_interpreter  s8   € ô" �MŠMðQä"Øò	ð —7‘7×+Ò+¨TÐ<°VÑ<Ð<r6   c                 ón   • [         R                  " S[        SS9  U R                  R                  " U0 UD6$ )NrŠ  rÙ   r‹  )rß   rà   rá   rP   Ú_save_to_buffer_for_mobiler?  s      r4   Ú$_save_to_buffer_for_lite_interpreterÚ:RecursiveScriptModule._save_to_buffer_for_lite_interpreter  s8   € ô
 �MŠMðQä"Øò	ð —7‘7×5Ò5°tÐF¸vÑFÐFr6   rµ   r¶   rë   c                 ó:   • U R                   R                  " U0 UD6$ r;   )rP   Úsave_to_bufferr?  s      r4   r•  Ú$RecursiveScriptModule.save_to_buffer,  s   € Ø—7‘7×)Ò)¨4Ð:°6Ñ:Ð:r6   c                 ó6   • U R                   R                  5       $ r;   )rP   Úget_debug_stater?  s      r4   r˜  Ú%RecursiveScriptModule.get_debug_state/  s   € Ø—7‘7×*Ñ*Ó,Ð,r6   c                 ó    • SU R                    3$ )Nzoriginal_name=)rF  rc   s    r4   Ú
extra_reprÚ RecursiveScriptModule.extra_repr2  s   € Ø# D×$6Ñ$6Ð#7Ð8Ð8r6   c                 óB   • U R                   R                  " U /UQ70 UD6$ r;   )rÍ   Ú	graph_forr?  s      r4   rž  ÚRecursiveScriptModule.graph_for5  s!   € Ø—<‘<×)Ò)¨$Ð@°Ò@¸Ñ@Ð@r6   c                 óà   • [        U 5      [        U R                  R                  5       R	                  5       5      L a  g[        U R                  R                  5       R	                  5       5      $ ©NÚ )r9   rò   rP   rw  rB   rc   s    r4   rF  Ú#RecursiveScriptModule.original_name8  sI   € ô �D‹zœS §¡§¡£×!5Ñ!5Ó!7Ó8Ò8ØÜ�t—w‘w—}‘}“×+Ñ+Ó-Ó.Ð.r6   c                 óx   • [         R                  " SS9nU R                  R                  U R                  X5        g )Nr)   rÚ   )râ   rã   rP   Ú_definer±   )rQ   rS  rT  s      r4   rQ  ÚRecursiveScriptModule.define?  s,   € ô  ×AÒAÈAÑNˆCØ�G‰G�O‰O˜D×/Ñ/°Õ:r6   rï   c                 óà  >• SU R                   ;  a  [        S5      eU R                  (       a  [        TU ]  U5      $ XR
                  ;   a  U R
                  U   $ U R                  R                  U5      (       a  U R                  R                  U5      $ U R                  R                  U5      (       a+  U R                  R                  U5      nX R                   U'   U$ [        TU ]  U5      $ )Nr  zKScriptModule has not been initialized, did you forget to call super's init?)rF   rh   r  rƒ   rÎ   r­   rP   rH   rA   r0  r}  )rQ   rï   rç   rE   s      €r4   rÎ   Ú!RecursiveScriptModule.__getattr__K  sÈ   ø€ Ø d§m¡mÓ3Ü"Øaóð ð ×!×!Ü‘wÑ*¨4Ó0Ð0ð —}‘}Ó$Ø—}‘} TÑ*Ð*Ø—‘—‘ ×&Ñ&Ø—w‘w—‘ tÓ,Ð,Ø—‘×$Ñ$ T×*Ñ*Ø $§¡× 3Ñ 3°DÓ 9�ð '4—‘˜dÑ#Ø$Ð$ä‘7Ñ& tÓ,Ð,r6   r8   Nc                 ó–  >• U R                   (       a  [        TU ]	  X5      $ XR                  ;   a  X R                  U'   g U R                  R                  U5      (       a  U R                  R                  X5        g [        U S5      (       a/  XR                  R                  5       ;   a  [        SU SU S35      e[        TU ]	  X5      $ )Nr±   z+Cannot mutate TorchScript constant value: 'z'. Value: 'Ú')
r  rƒ   r*  r­   rP   rH   ro   r±   Úget_constantsÚAttributeErrorr,  s      €r4   r*  Ú!RecursiveScriptModule.__setattr__c  s®   ø€ Ø×!×!Ü‘wÑ*¨4Ó7Ð7à—}‘}Ó$Ø&+—‘˜dÒ#Ø—‘—‘ ×&Ñ&Ø—‘—‘ Õ,ä˜Ð.×/Ñ/Ø×/Ñ/×=Ñ=Ó?Ó?ô %ØAÀ$ÀÀ{ÐSXÐRYÐYZÐ[óð ô ‘wÑ*¨4Ó7Ð7r6   c                 ó�   • [         R                  R                  R                  [        R                  " U R
                  5      5      $ r;   )r„   r®   r¯   r   ÚcopyrP   rc   s    r4   Ú__copy__ÚRecursiveScriptModule.__copy__~  s*   € Ü—9‘9×'Ñ'×7Ñ7¼¿	º	À$Ç'Á'Ó8JÓKÐKr6   Úmemoc                 ó’   • [         R                  R                  R                  [        R
                  " U R                  U5      5      $ r;   )r„   r®   r¯   r   r¯  ÚdeepcopyrP   )rQ   r²  s     r4   Ú__deepcopy__Ú"RecursiveScriptModule.__deepcopy__�  s,   € Ü—9‘9×'Ñ'×7Ñ7¼¿ºÀdÇgÁgÈtÓ8TÓUÐUr6   r.  c                 ór   • [        X5      n[        USS 5      [        [        U5      :X  a  [        eU" U0 UD6$ )NÚ__func__)rA   re  ÚNotImplementedErrorr2  s        r4   r4  Ú*RecursiveScriptModule.forward_magic_methodˆ  sC   € ô " $Ó4ˆKÜ�{ J°Ó5¼Ü% {ó:ó ô *Ð)Ù Ð/¨Ñ/Ð/r6   c                 ó$   • U R                  S5      $ )Nrÿ   ©r4  rc   s    r4   rÿ   ÚRecursiveScriptModule.__iter__’  s   € Ø×,Ñ,¨ZÓ8Ð8r6   Úidxc                 ó&   • U R                  SU5      $ )Nrx   r¼  )rQ   r¾  s     r4   rx   Ú!RecursiveScriptModule.__getitem__•  s   € Ø×,Ñ,¨]¸CÓ@Ð@r6   c                 ó$   • U R                  S5      $ )Nrd   r¼  rc   s    r4   rd   ÚRecursiveScriptModule.__len__˜  s   € Ø×,Ñ,¨YÓ7Ð7r6   c                 ó&   • U R                  SU5      $ )Nrt   r¼  )rQ   Úkeys     r4   rt   Ú"RecursiveScriptModule.__contains__›  s   € Ø×,Ñ,¨^¸SÓAÐAr6   c                 ó€   >• U R                   nUR                  [        [        S5      L a  [        TU ]  5       $ U" 5       $ )NÚ__dir__)rÇ  r¸  rC   re  rƒ   )rQ   r3  rE   s     €r4   rÇ  ÚRecursiveScriptModule.__dir__   s=   ø€ ØŸ,™,ˆKà×$Ñ$Ü*Ô+@À)ÓLòMô ‘w‘Ó(Ð(Ù“=Ð r6   c                 ód   • U R                   nUR                  [        [        S5      L a  gU" 5       $ )Nr  T)r  r¸  rC   re  )rQ   r3  s     r4   r  ÚRecursiveScriptModule.__bool__¬  s2   € ØŸ-™-ˆKà×$Ñ$Ü*Ô+@À*ÓMòNð Ù“=Ð r6   c                 ód   • S n[         R                  U R                  R                  5       U5      $ )Nc                 ó   • g r;   r<   rr  s    r4   rk  ÚCRecursiveScriptModule._replicate_for_data_parallel.<locals>.init_fn¸  s   € àr6   )re  rm  rP   rW  )rQ   rk  s     r4   rW  Ú2RecursiveScriptModule._replicate_for_data_parallelµ  s.   € òô
 )×3Ñ3Ø—‘×4Ñ4Ó6¸óð r6   )rF   r¬   rP   r±   r­   r«   )/rz   r{   r|   r}   r=  r    rR   Ústaticmethodrm  rj  rz  r  rD  rE  rB  rC  r†  r
   rŽ  r’  r   r•  r˜  rò   r›  rž  rF  rQ  rÎ   r*  r   r°  Údictr^  rµ  r4  r   rÿ   rx   rd   rt   r   rÇ  r  rW  r~   r˜   r™   s   @r4   re  re  j  s"  ø† ñ	ð0  $Ðõ	&ð 
ñ	!ó 
ð	!ð. 
ñ
	0ó 
ð
	0ò	3ð@ 
ñ	8ó 
ð	8ð 
ñ	.ó 
ð	.ð 
ñ	%ó 
ð	%ð 
ñ	*ó 
ð	*ò		2ñ 
ðMó

ñ	=ó	

ð	=ñ* 
ðMó

ñ	Gó	

ð	Gð	;¨ð 	;°sð 	;¸sô 	;ð	-¨ð 	-¸ð 	-Àô 	-ð	9 ô 	9ð	A 3ð 	A°#ð 	A¸#ô 	Að 
ñ	/ó 
ð	/ò
	;ð	- Cð 	-¨C÷ 	-ð0	8 Cð 	8°ð 	8¸÷ 	8ð6	L˜dô 	Lð	V T¨#¨s¨(¡^°dÑ%:ð 	V¸tô 	Vð	0Ø"ð	0Ø+.ð	0Ø:=ð	0àô	0ð	9˜h s™mô 	9ð	A 3ð 	A¨3ô 	Aò	8ò	Bð
	!˜X c™]÷ 	!ò	!÷
	ð 
	r6   re  Ú__c                 ó6   ^• SS K mTR                  " U U4S jS9$ )Nr   c                 óZ   >• TR                   " U 5      =(       d    TR                  " U 5      $ r;   )Ú
isfunctionÚismethod)ÚxÚinspects    €r4   r¢   Ú_get_methods.<locals>.<lambda>Ö  s#   ø€  W×%7Ò%7¸Ó%:×%Q¸g×>NÒ>NÈqÓ>QÐ%Qr6   )Ú	predicate)r×  Ú
getmembers)r3   r×  s    @r4   Ú_get_methodsrÛ  Ñ  s!   ø€ Ûð ×!Ò!ØÔQñ
ð 	
r6   >%   ÚtoÚcpuÚcudaÚevalÚhalfr9   ÚapplyÚfloatÚtrainÚ_applyÚdoubleÚbuffersrÍ   ry  ÚchildrenÚ	_get_nameÚ	zero_gradÚ
add_moduler›  Ú
parametersÚ
state_dictÚshare_memoryÚ_slow_forwardÚ_tracing_nameÚnamed_buffersÚnamed_modulesÚ_named_membersÚnamed_childrenÚget_extra_stateÚload_state_dictÚregister_bufferÚregister_moduleÚset_extra_stateÚnamed_parametersÚregister_parameterÚ_save_to_state_dictÚ_load_from_state_dictc                 ó   ^ • U 4S jnU$ )Nc                 ó    >• [        TS-   5      e)Nz" is not supported on ScriptModulesrg   )rQ   rµ   r¶   rB   s      €r4   ÚfailÚ_make_fail.<locals>.fail  s   ø€ Ü˜tÐ&JÑJÓKÐKr6   r<   )rB   rÿ  s   ` r4   Ú
_make_failr    s   ø€ õ	Lð ˆr6   Ú
_call_implc                   ó   • \ rS rSrSrg)r  i  r<   NrÔ   r<   r6   r4   r  r    s   † Úr6   c                   ó,   ^ • \ rS rSrSU 4S jjrSrU =r$ )r”   i  c                 ó"   >• [         TU ]  5         g r;   rH  ©rQ   ÚargrE   s     €r4   rR   rI    rJ  r6   r<   r;   rÉ   r™   s   @r4   r”   r”     ó   ø† ÷	õ 	r6   c                   ó,   ^ • \ rS rSrSU 4S jjrSrU =r$ )re  i  c                 ó"   >• [         TU ]  5         g r;   rH  r  s     €r4   rR   rh    rJ  r6   r<   r;   rÉ   r™   s   @r4   re  re    r  r6   c                 ó€  • [        U [        R                  R                  5      (       d  U $ [	        U 5      nX!;   a  U[	        U 5         $ [        U S5      (       a  U R                  5       OU n XU'   0 nU R                  R                  5        Hˆ  u  pEUS:X  a,  UR                  5        H  u  pg[        Xq5      XV'   M     XSU'   M7  [        U[        R                  R                  5      (       a$  [        U[        5      (       d  [        XQ5      X4'   M„  XSU'   MŠ     UR                  5        H  nXpR                  W'   M     U $ )NÚ__prepare_scriptable__r­   )r“   r„   Únnr"   ÚidrH   r  rF   rV   Ú!call_prepare_scriptable_func_implr”   r_   )rÏ   r²  Úobj_idÚnew_obj_dictrB   Ú
sub_modulerX   rY   s           r4   r  r     s  € Ü�cœ5Ÿ8™8Ÿ?™?×+Ñ+Øˆ
ä�‹W€Fð ƒ~Ø”B�s“G‰}Ðô )0°Ð5M×(NÑ(Nˆ×"Ñ"Ô$ÐTWð ð ˆ�Là€LàŸL™L×.Ñ.Ö0ÑˆØ�:ÓØ"×(Ñ(Ö*‘�Ü AÀ!Ó J�
“ñ +à!+˜ÓÜ˜
¤E§H¡H§O¡O×4Ñ4¼ZØœ÷>
ñ >
ô "CÀ:Ó!TˆLÓà!+˜Óñ 1ð × Ñ Ö"ˆØ�‰�TÓñ #ð €Jr6   c                 ó   • 0 n[        X5      $ r;   )r  )rÏ   r²  s     r4   Úcall_prepare_scriptable_funcr  G  s   € Ø')€DÜ,¨SÓ7Ð7r6   c                 ó@   • [         R                  R                  U 5      $ )aŽ  
Create a ``torch._C.ScriptDict`` instance with the data from ``obj``.

Args:
    obj (dict): The Python dictionary that is used to initialize the ``ScriptDict``
                returned by this function.

Returns:
    An instance of ``torch._C.ScriptDict`` that has the same data as ``obj``
    and can be passed between Python and TorchScript with reference semantics and
    zero copy overhead.
)r„   r…   Ú
ScriptDict)rÏ   s    r4   Úcreate_script_dictr  L  s   € ô �8‰8×Ñ˜sÓ#Ð#r6   c                 ó@   • [         R                  R                  U 5      $ )a‡  
Create a ``torch._C.ScriptList`` instance with the data from ``obj``.

Args:
    obj (dict): The Python list that is used to initialize the ``ScriptList``
                returned by this function.
Returns:
    An instance of ``torch._C.ScriptList`` that has the same data as ``obj``
    and can be passed between Python and TorchScript with reference semantics and
    zero copy overhead.
)r„   r…   Ú
ScriptList)rÏ   Ú	type_hints     r4   Úcreate_script_listr  \  s   € ô �8‰8×Ñ˜sÓ#Ð#r6   TÚ	_TOPLEVELÚexample_inputsc                 óö  • Ub  [         R                  " S[        SS9  [        U [        5      (       a  U $ [        U [
        5      (       a  U $ [        U [        5      (       a  U $ U(       aº  [        5       q[        (       a�  [        [        5      n[        U5         [        U[        5      (       a(  UR                  5        H  u  pgU H  nU" U6   M
     M     O/[        U[        5      (       a  U H  n	U " U	6   M
     O[        S5      eS S S 5        O[         R                  " SSS9  [        U [        R                   R"                  5      (       aW  [%        U 5      n [        R&                  R(                  R+                  U [        R&                  R(                  R,                  5      $ [/        U S5      (       a  U R1                  5       OU n [        U [        5      (       a  [3        U 5      $ [        U [        5      (       a  [5        U 5      $ [6        R8                  " U 5      (       aÑ  [;        U 5      n
[=        U [        R                   R"                  5      (       a  [?        SU  S	35      e[=        U [@        RB                  5      (       a  U $ [E        U 5      (       d  [?        S
5      e[G        U RI                  5       5      S:”  a  [?        S5      eUc  [J        RL                  " US-   5      n[O        XU
5        U $ [6        RP                  " U 5      (       d  [6        RR                  " U 5      (       Ga  [;        U 5      n
[/        U S5      (       a"  U RT                  n [J        RV                  " U 5      n[/        U S5      (       a  [?        SU RX                  -   5      e[[        U 5        []        U 5      nU(       a  Xl/        U$ [a        X Rb                  5      nUc  [J        RV                  " U 5      n[        Rd                  Rg                  X¬U[i        U 5      5      nU Rj                  Ul5        SUl1        SUl6        Xl/        [o        X5        U$ [        R&                  R(                  Rq                  U 5      $ ! , (       d  f       GNT= f)Nz^`optimize` is deprecated and has no effect. Use `with torch.jit.optimized_execution()` insteadr×   r‹  zˆError: Unable to infer types. Please format the inputs to type `List[Tuple]` or `Dict[Callable, List[Tuple]]` to be run with MonkeyType.zîWarning: monkeytype is not installed. Please install https://github.com/Instagram/MonkeyType to enable Profile-Directed Typing in TorchScript. Refer to https://github.com/Instagram/MonkeyType/blob/master/README.rst to install MonkeyType. rÙ   r  zType 'zO' cannot be compiled since it inherits from nn.Module, pass an instance insteadzLTorchScript classes must be new-style classes. Please inherit from 'object'.z\TorchScript classes does not support inheritance yet. Please directly inherit from 'object'.r)   Ú__script_if_tracing_wrapperÚ__script_unsupportedzTorchScript error: r,   r-   )9rß   rà   ÚFutureWarningr“   r  r”   r,   r   r>   r   r   rÐ  rV   ÚlistÚ
ValueErrorr„   r  r"   r  r®   r¯   r°   r   rH   r  r  r  r×  Úisclassr   Ú
issubclassrh   ÚenumÚEnumrJ   rb   Úmrorâ   rã   r   rÔ  rÕ  Ú__original_fnÚ#createResolutionCallbackFromClosurer   Ú"_check_directly_compile_overloadedr   Ú_torchdynamo_inliner!   rz   r…   Ú_jit_script_compiler   r=  r|   r   Úcreate_script_class)rÏ   ÚoptimizeÚ
_frames_uprå   r  Úmonkeytype_configrˆ   Úexample_inputÚexampleÚexamplesÚqualified_nameÚmaybe_already_compiled_fnræ   rä   s                 r4   Ú_script_implr7  n  sÀ  € ð ÑÜ�ŠðAäØò		
ô �#Ô+×,Ñ,Øˆ
Ü�#”|×$Ñ$Øˆ
Ü�#”~×&Ñ&Øˆ
æô
 *Ó+ˆßÒä 2´=Ó AÐÜ!Ð"3Õ4Ü˜n¬d×3Ñ3ð 2@×1EÑ1EÖ1GÑ-˜Û'4˜GÙ" GÓ,ó (5ò 2Hô   ´×5Ñ5Û$2˜Ù˜X›ò %3ô %ðWóð ÷ 5Ð4ô& �MŠMðið ò	ô �#”u—x‘x—‘×'Ñ'Ü*¨3Ó/ˆÜ�y‰y×#Ñ#×8Ñ8Ø”—‘×%Ñ%×>Ñ>ó
ð 	
ô �sÐ4×5Ñ5ð ×&Ñ&Ô(àð 	ô �#”t×ÑÜ! #Ó&Ð&Ü�#”t×ÑÜ! #Ó&Ð&ä‡‚�s×ÑÜ(¨Ó-ˆô �cœ5Ÿ8™8Ÿ?™?×+Ñ+ÜØ˜˜ÐlÐmóð ô �cœ4Ÿ9™9×%Ñ%ØˆJä" 3×'Ñ'Üð0óð ô ˆs�w‰w‹y‹>˜AÓÜð9óð ð ‰<Ü ×BÒBÀ:ÐPQÁ>ÓRˆDÜ# C¨~Ô>Øˆ
Ü	×	Ò	˜C×	 Ñ	 ¤G×$4Ò$4°S×$9Ò$9Ü(¨Ó-ˆä�3Ð5×6Ñ6Ø×#Ñ#ˆCÜ ×DÒDÀSÓIˆDô �3Ð.×/Ñ/ÜÐ4°s×7OÑ7OÑOÓPÐPä*¨3Ô/Ü$@ÀÓ$EÐ!Þ$Ø<?Ô9Ø,Ð,Ü˜#Ÿ|™|Ó,ˆØ‰<Ü ×DÒDÀSÓIˆDÜ�X‰X×)Ñ)Ø Ô'7¸Ó'<ó
ˆð —[‘[ˆŒ
Ø&ˆŒØ4ˆŒà!$ÔÜ Ô(Øˆ	ä�y‰y×#Ñ#×7Ñ7¸Ó<Ð<÷M 5Ö4ús   ÂA-Q)Ñ)
Q8rÏ   r/  r0  rå   c                 ó.  • [         R                  S:¼  a  [        R                  " S[        5        O[        R                  " S[        5        [
        (       d  U $  [        nSq[        U UUS-   UUS9nU(       a  [        S[        U5      S9  UUq$ ! Wqf = f)	ay  Script the function.

Scripting a function or ``nn.Module`` will inspect the source code, compile
it as TorchScript code using the TorchScript compiler, and return a :class:`ScriptModule` or
:class:`ScriptFunction`. TorchScript itself is a subset of the Python language, so not all
features in Python work, but we provide enough functionality to compute on
tensors and do control-dependent operations. For a complete guide, see the
:ref:`language-reference`.

Scripting a dictionary or list copies the data inside it into a TorchScript instance than can be
subsequently passed by reference between Python and TorchScript with zero copy overhead.

``torch.jit.script`` can be used as a function for modules, functions, dictionaries and lists
 and as a decorator ``@torch.jit.script`` for torchscript-classes and functions.

Args:
    obj (Callable, class, or nn.Module):  The ``nn.Module``, function, class type,
                                              dictionary, or list to compile.
    example_inputs (Union[List[Tuple], Dict[Callable, List[Tuple]], None]): Provide example inputs
        to annotate the arguments for a function or ``nn.Module``.

Returns:
    If ``obj`` is ``nn.Module``, ``script`` returns
    a :class:`ScriptModule` object. The returned :class:`ScriptModule` will
    have the same set of sub-modules and parameters as the
    original ``nn.Module``. If ``obj`` is a standalone function,
    a :class:`ScriptFunction` will be returned. If ``obj`` is a ``dict``, then
    ``script`` returns an instance of `torch._C.ScriptDict`. If ``obj`` is a ``list``,
    then ``script`` returns an instance of `torch._C.ScriptList`.

**Scripting a function**
    The ``@torch.jit.script`` decorator will construct a :class:`ScriptFunction`
    by compiling the body of the function.

    Example (scripting a function):

    .. testcode::

        import torch

        @torch.jit.script
        def foo(x, y):
            if x.max() > y.max():
                r = x
            else:
                r = y
            return r

        print(type(foo))  # torch.jit.ScriptFunction

        # See the compiled graph as Python code
        print(foo.code)

        # Call the function using the TorchScript interpreter
        foo(torch.ones(2, 2), torch.ones(2, 2))

    .. testoutput::
        :hide:

        ...

****Scripting a function using example_inputs**
    Example inputs can be used to annotate a function arguments.

    Example (annotating a function before scripting):

    .. testcode::

        import torch

        def test_sum(a, b):
            return a + b

        # Annotate the arguments to be int
        scripted_fn = torch.jit.script(test_sum, example_inputs=[(3, 4)])

        print(type(scripted_fn))  # torch.jit.ScriptFunction

        # See the compiled graph as Python code
        print(scripted_fn.code)

        # Call the function using the TorchScript interpreter
        scripted_fn(20, 100)

    .. testoutput::
        :hide:

        ...

**Scripting an nn.Module**
    Scripting an ``nn.Module`` by default will compile the ``forward`` method and recursively
    compile any methods, submodules, and functions called by ``forward``. If a ``nn.Module`` only uses
    features supported in TorchScript, no changes to the original module code should be necessary. ``script``
    will construct :class:`ScriptModule` that has copies of the attributes, parameters, and methods of
    the original module.

    Example (scripting a simple module with a Parameter):

    .. testcode::

        import torch

        class MyModule(torch.nn.Module):
            def __init__(self, N, M):
                super().__init__()
                # This parameter will be copied to the new ScriptModule
                self.weight = torch.nn.Parameter(torch.rand(N, M))

                # When this submodule is used, it will be compiled
                self.linear = torch.nn.Linear(N, M)

            def forward(self, input):
                output = self.weight.mv(input)

                # This calls the `forward` method of the `nn.Linear` module, which will
                # cause the `self.linear` submodule to be compiled to a `ScriptModule` here
                output = self.linear(output)
                return output

        scripted_module = torch.jit.script(MyModule(2, 3))

    Example (scripting a module with traced submodules):

    .. testcode::

        import torch
        import torch.nn as nn
        import torch.nn.functional as F

        class MyModule(nn.Module):
            def __init__(self) -> None:
                super().__init__()
                # torch.jit.trace produces a ScriptModule's conv1 and conv2
                self.conv1 = torch.jit.trace(nn.Conv2d(1, 20, 5), torch.rand(1, 1, 16, 16))
                self.conv2 = torch.jit.trace(nn.Conv2d(20, 20, 5), torch.rand(1, 20, 16, 16))

            def forward(self, input):
                input = F.relu(self.conv1(input))
                input = F.relu(self.conv2(input))
                return input

        scripted_module = torch.jit.script(MyModule())

    To compile a method other than ``forward`` (and recursively compile anything it calls), add
    the :func:`@torch.jit.export <torch.jit.export>` decorator to the method. To opt out of compilation
    use :func:`@torch.jit.ignore <torch.jit.ignore>` or :func:`@torch.jit.unused <torch.jit.unused>`.

    Example (an exported and ignored method in a module)::

        import torch
        import torch.nn as nn


        class MyModule(nn.Module):
            def __init__(self) -> None:
                super().__init__()

            @torch.jit.export
            def some_entry_point(self, input):
                return input + 10

            @torch.jit.ignore
            def python_only_fn(self, input):
                # This function won't be compiled, so any
                # Python APIs can be used
                import pdb

                pdb.set_trace()

            def forward(self, input):
                if self.training:
                    self.python_only_fn(input)
                return input * 99


        scripted_module = torch.jit.script(MyModule())
        print(scripted_module.some_entry_point(torch.randn(2, 2)))
        print(scripted_module(torch.randn(2, 2)))

    Example ( Annotating forward of nn.Module using example_inputs)::

        import torch
        import torch.nn as nn
        from typing import NamedTuple

        class MyModule(NamedTuple):
        result: List[int]

        class TestNNModule(torch.nn.Module):
            def forward(self, a) -> MyModule:
                result = MyModule(result=a)
                return result

        pdt_model = TestNNModule()

        # Runs the pdt_model in eager model with the inputs provided and annotates the arguments of forward
        scripted_model = torch.jit.script(pdt_model, example_inputs={pdt_model: [([10, 20, ], ), ], })

        # Run the scripted_model with actual inputs
        print(scripted_model([20]))
rÖ   zv`torch.jit.script` is not supported in Python 3.14+ and may break. Please switch to `torch.compile` or `torch.export`.zU`torch.jit.script` is deprecated. Please switch to `torch.compile` or `torch.export`.Fr)   )rÏ   r/  r0  rå   r  Úscript)Úmodel_id)
rÝ   rÞ   rß   rà   rá   r   r  r7  r   r   )rÏ   r/  r0  rå   r  ÚprevÚrets          r4   r9  r9  ù  s–   € ô` ×Ñ˜7Ó"Ü�ŠðBäõ	
ô 	�ŠØcÜô	
÷ Š8Øˆ
ðäˆØˆ	ÜØØØ! A‘~ØØ)ñ
ˆö Ü! (´]À3Ó5GÒHàà‰	ø�D‰	ús   Á3B ÂBc                 óª   • UR                  5        H?  u  p4X0;  d
  X   U:w  d  M  [        R                  R                  R	                  USU 35      e   g )Nz™Default parameters on overloads do not affect the runtime so they must equal to the default parameter on the implementation function. Found on parameter )rV   r„   r®   ÚfrontendÚFrontendError)Úimpl_defaultsÚoverload_defaultsÚlocrB   Úoverload_values        r4   Ú_check_overload_defaultsrD  î  sW   € Ø 1× 7Ñ 7Ö 9ÑˆØÓ$¨Ñ(;¸~Õ(MÜ—)‘)×$Ñ$×2Ñ2Øðà!˜Fð$óð ò !:r6   c                 óÊ  • [        X R                  5      R                  5       n[        R                  R
                  R                  U S S [        R                  " U 5      5      n[        X"R                  5      n[        U 5      n[        U5      n[        R                  " U5      n[        XvUR                  5       5        [        R                  R                  UUUUUU5      n	U	$ r;   )r!   rz   Údeclr„   r®   ÚannotationsÚget_signaturer×  rÕ  r   râ   r*  rD  Úranger…   Ú_jit_script_compile_overload)
Úoverload_fnÚ	qual_nameÚimpl_fnÚoverload_declÚoverload_signatureÚimpl_astrA  Úimplementation_defaultsrå   rä   s
             r4   Ú_compile_function_with_overloadrR  ù  sÇ   € Ü ×-AÑ-AÓB×GÑGÓI€MÜŸ™×.Ñ.×<Ñ<Ø�T˜4¤×!1Ò!1°+Ó!>óÐô ˜7×$4Ñ$4Ó5€HÜ(¨Ó5ÐÜ.¨wÓ7ÐÜ×<Ò<¸WÓE€DÜØ°M×4GÑ4GÓ4Iôô 
�‰×	.Ñ	.ØØØØØØó
€Bð €Ir6   c                 óL  • [        U 5      n[        U 5      n[        R                  " U5      nUc  U$ X;   a   [	        [        R
                  " SU 5      5      eU Vs/ s H  n[        XBU 5      PM     nnU(       a  X-   n[        X5        [        R                  " U5        U$ s  snf )NÚfunction)	r   r   râ   Ú_get_fn_overloadsrh   Ú,get_overload_no_implementation_error_messagerR  r   Ú_clear_fn_overloads)rÏ   Úexisting_compiled_fnsrL  Úuncompiled_overloadsrK  Úcompiled_fnss         r4   Ú_get_overloadsr[    s±   € ä9¸#Ó>ÐÜ Ó$€IÜ(×:Ò:¸9ÓEÐØÑ#Ø$Ð$à
Ó"ÜÜ×FÒFÀzÐSVÓWó
ð 	
ñ 0óâ/ˆKô 	(¨ÀÖDÙ/ð ð ö
 Ø,Ñ;ˆô ˜CÔ.Ü×%Ò% iÔ0ØÐùòs   ÁB!c                 óŽ   • [        U 5      n[        R                  " U5      (       d  [        U 5      (       a  [	        SU S35      eg )Nz	Function z˜ cannot be directly compiled because it is overloaded. It must be used in a context of a function where its inputs can determine which overload to call.)r   râ   rU  r   rh   )rÏ   rL  s     r4   r+  r+  +  sO   € Ü Ó$€IÜ×&Ò& y×1Ñ1Ô5RÐSV×5WÑ5WÜØ˜	�{ð #Fð Fó
ð 	
ð 6Xr6   c                 ób  • [         R                  " S[        5        [        R                  " U 5      (       d  [        S5      e[        U 5      (       d  [        S5      e[        U [        R                  R                  5      =(       a    [        U R                  5       5      S:H  nU(       d(  [        U R                  5       5      S:”  a  [        S5      e[        U 5      n[        R                  " S5      n[!        X R"                  5      n[        R$                  R'                  X$X15      nXPl        U $ )a$  Decorate to annotate classes or modules of different types.

.. deprecated:: 2.5
    TorchScript is deprecated, please use ``torch.compile`` instead.

This decorator can be used to define an interface that can be used to annotate
classes or modules of different types. This can be used for to annotate a submodule
or attribute class that could have different types that implement the same
interface, or which could be swapped at runtime; or to store a list of modules or
classes of varying types.

It is sometimes used to implement "Callables" - functions or modules that implement
an interface but whose implementations differ and which can be swapped out.

Example:
.. testcode::

    import torch
    from typing import List

    @torch.jit.interface
    class InterfaceType:
        def run(self, x: torch.Tensor) -> torch.Tensor:
            pass

    # implements InterfaceType
    @torch.jit.script
    class Impl1:
        def run(self, x: torch.Tensor) -> torch.Tensor:
            return x.relu()

    class Impl2(torch.nn.Module):
        def __init__(self) -> None:
            super().__init__()
            self.val = torch.rand(())

        @torch.jit.export
        def run(self, x: torch.Tensor) -> torch.Tensor:
            return x + self.val

    def user_fn(impls: List[InterfaceType], idx: int, val: torch.Tensor) -> torch.Tensor:
        return impls[idx].run(val)

    user_fn_jit = torch.jit.script(user_fn)

    impls = [Impl1(), torch.jit.script(Impl2())]
    val = torch.rand(4, 4)
    user_fn_jit(impls, 0, val)
    user_fn_jit(impls, 1, val)
zH`torch.jit.interface` is deprecated. Please use `torch.compile` instead.z$interface must be applied to a classz1TorchScript interfaces must inherit from 'object'r×   rÙ   zmTorchScript interface does not support inheritance yet. Please directly inherit from 'object' or 'nn.Module'.r)   )rß   rà   rá   r×  r$  rh   rJ   r%  r„   r  r"   rb   r(  r   râ   rã   r    rz   r…   Ú_jit_script_interface_compileÚ__torch_script_interface__)rÏ   Úis_module_interfacer5  rT  ræ   Úmangled_classnames         r4   Ú	interfacerb  5  sñ   € ôf ‡M‚MØRÜôô �?Š?˜3×ÑÜÐAÓBÐBÜ˜s×#Ñ#ÜÐNÓOÐOô % S¬%¯(©(¯/©/Ó:×R¼sÀ3Ç7Á7Ã9»~ÐQRÑ?RÐæ¤3 s§w¡w£y£>°AÓ#5ÜðDó
ð 	
ô
 % SÓ)€NÜ
×
9Ò
9¸!Ó
<€Cô ˜C§¡Ó
.€CÜŸ™×>Ñ>Ø˜SóÐð &7Ô"Ø€Jr6   c                 óš   • [        U 5      n[        R                  R                  X!5      n[        R
                  " U 5      n[        XU5      $ r;   )r   r„   r…   Ú	CallStackrâ   Ú'createResolutionCallbackForClassMethodsr   )rÏ   rB  Ú
_qual_nameÚerror_stackrT  s        r4   Ú_recursive_compile_classrh  Š  s?   € Ü  Ó%€Jô —(‘(×$Ñ$ ZÓ5€KÜ
×
?Ò
?ÀÓ
D€CÜ& s°Ó<Ð<r6   ÚsÚpaddingÚoffsetÚcharc                 ó¤   • U[        U 5      :¼  a  U[        U 5      -  nSR                  [        X-   5       Vs/ s H  oCPM     sn5      U -   $ s  snf r¡  )rb   ÚjoinrI  )ri  rj  rk  rl  rº   s        r4   Úpadro  —  sL   € Ø”#�a“&ÓØ”3�q“6ÑˆØ�7‰7¤%¨Ñ(8Ô"9Ó:Ò"9˜Q’DÑ"9Ñ:Ó;¸aÑ?Ð?ùÒ:s   ¸Ac                   óF   • \ rS rSrSS\S\S\4S jjrS\S\4S jrS	 r	S
r
g)Ú_ScriptProfileColumni�  ÚheaderÚ	alignmentrk  c                 ó6   • Xl         X l        X0l        0 U l        g r;   )rr  rs  rk  Úrows)rQ   rr  rs  rk  s       r4   rR   Ú_ScriptProfileColumn.__init__ž  s   € ØŒØ"ŒØŒØ$&ˆ�	r6   Úlinenor8   c                 ó    • X R                   U'   g r;   )ru  )rQ   rw  r8   s      r4   Úadd_rowÚ_ScriptProfileColumn.add_row¤  s   € Ø!�	‰	�&Òr6   c           
      óæ  • [        U R                  5      n/ nU R                  R                  5        H7  u  p4[	        U5      nUR                  X545        [        [        U5      U5      nM9     U R                  S:”  a   XR                  -   nXfU R                  -  -  nOSnU VVs/ s H  u  p5U[        XVU R                  5      4PM     nnn[        U R                  X`R                  5      U4$ s  snnf )Nr   )
rb   rr  ru  rV   rò   ÚappendÚmaxrs  ro  rk  )rQ   Ú
max_lengthru  rÄ  r8   Úcellrj  s          r4   ÚmaterializeÚ _ScriptProfileColumn.materialize§  sÉ   € Ü˜Ÿ™Ó%ˆ
Ø&(ˆØŸ)™)Ÿ/™/Ö+‰JˆCÜ�u“:ˆDØ�K‰K˜˜Ô$ÜœS ›Y¨
Ó3ŠJñ ,ð
 �>‰>˜AÓØ §>¡>Ñ1ˆGØ §¡Ñ/Ñ/‰GàˆGáHLÔMÊ¹9¸3�”c˜$¨¯©Ó5Ó6ÉˆÑMÜ�4—;‘; ¯©Ó5°tÐ;Ð;ùó Ns   Â$$C-)rs  rr  rk  ru  N)é   r   )rz   r{   r|   r}   rò   r^  rR   r   ry  r€  r~   r<   r6   r4   rq  rq  �  s4   † ñ'˜sð '¨sð 'Àõ 'ð"˜cð "¨#ô "õ<r6   rq  c                   ó8   • \ rS rSrS\\   S\\   4S jrS rSr	g)Ú_ScriptProfileTablei¹  ÚcolsÚsource_rangec                 ó   • Xl         X l        g r;   ©r…  r†  )rQ   r…  r†  s      r4   rR   Ú_ScriptProfileTable.__init__º  s   € ØŒ	Ø(Õr6   c           	      óî  • / n/ nSnU R                    H5  nUR                  5       u  pVX5-  nUR                  U[        U5      45        M7     UR                  U5        UR                  [	        S[        U5      SS5      5        U R                   HS  nSnU H7  u  pVUR                  U5      n	U	c  U[	        S[        U5      5      -  nM3  X‰-  nM9     UR                  U5        MU     SR                  U5      $ )Nr¢  r   Ú=Ú
)	r…  r€  r|  rÐ  ro  rb   r†  r%  rn  )
rQ   ÚoutputsÚcellsÚheader_bufferÚcolrr  ru  ÚlineÚ
row_bufferr  s
             r4   Údump_stringÚ_ScriptProfileTable.dump_string¾  sã   € ØˆØ24ˆØˆØ—9”9ˆCØŸ?™?Ó,‰LˆFØÑ#ˆMØ�L‰L˜&¤$ t£*Ð-Ö.ñ ð
 	�‰�}Ô%Ø�‰”s˜2œs =Ó1°1°cÓ:Ô;Ø×%Ô%ˆDØˆJÛ %‘�Ø—x‘x “~�Ø‘<Ø¤# b¬#¨f«+Ó"6Ñ6’JàÑ&’Jñ !&ð �N‰N˜:Ö&ñ &ð �y‰y˜Ó!Ð!r6   rˆ  N)
rz   r{   r|   r}   r"  rq  r^  rR   r“  r~   r<   r6   r4   r„  r„  ¹  s$   † ð)˜TÐ"6Ñ7ð )ÀtÈCÁyô )õ"r6   r„  c                   ó>   • \ rS rSrS
S jrS rS rS\4S jrS r	S	r
g)Ú_ScriptProfileiÕ  rë   Nc                 óJ   • [         R                  R                  5       U l        g r;   )r   Ú	profilingr–  Úprofilerc   s    r4   rR   Ú_ScriptProfile.__init__Ö  s   € Ü×(Ñ(×7Ñ7Ó9ˆ�r6   c                 ó8   • U R                   R                  5         g r;   )r™  Úenablerc   s    r4   rœ  Ú_ScriptProfile.enableÙ  s   € Ø�‰×ÑÕr6   c                 ó8   • U R                   R                  5         g r;   )r™  Údisablerc   s    r4   rŸ  Ú_ScriptProfile.disableÜ  s   € Ø�‰×ÑÕr6   c                 ób  • / nU R                   R                  5        GHy  nUR                  5       nUR                  5       R	                  5       n[        S U 5       5      nU Vs/ s H  ofUS  PM	     nnUR                  5       nU[        U5      -   n[        Xx5      n	[        S5      n
[        S5      n[        S5      n[        SSS5      nUR                  5       nU	 H~  nU
R                  Xf5        UR                  XdXg-
     5        UR                  U5      nUc  M@  UR                  XoR                  5       5        UR                  XoR                  5       5        M€     [        X«XÍ/[!        U	5      5      nUR#                  UR%                  5       5        GM|     SR'                  U5      $ s  snf )	Nc              3   ón   #   • U  H+  n[        U5      [        UR                  S 5      5      -
  v •  M-     g7f)Ú N)rb   Úlstrip)Ú.0r‘  s     r4   Ú	<genexpr>Ú-_ScriptProfile.dump_string.<locals>.<genexpr>ä  s'   é € ÐTÂ|¸tœ˜T›¤S¨¯©°SÓ)9Ó%:Ö:Â|ùs   ‚35zLine #ÚHitsz	Time (ns)zLine Contentsr   r)   z

)r™  Ú_dump_statsÚsourceÚtextÚ
splitlinesÚminÚstarting_linenorb   rI  rq  Úline_mapry  r%  ÚcountÚduration_nsr„  r"  r|  r“  rn  )rQ   r�  Úsource_statsÚ
source_refÚsource_linesÚdedentr‘  Ú
start_lineÚend_liner†  rw  ÚhitsÚtime_nsÚline_contentsÚstatsÚstatÚtables                    r4   r“  Ú_ScriptProfile.dump_stringß  sy  € ØˆØ ŸL™L×4Ñ4×6ˆLØ%×,Ñ,Ó.ˆJØ%Ÿ?™?Ó,×7Ñ7Ó9ˆLÜÑTÁ|ÓTÓTˆFÙ6BÓC²l¨d  ›M±lˆLÐCà#×3Ñ3Ó5ˆJØ!¤C¨Ó$5Ñ5ˆHÜ  Ó6ˆLÜ)¨(Ó3ˆFÜ'¨Ó/ˆDÜ*¨;Ó7ˆGÜ0°À!ÀQÓGˆMØ ×)Ñ)Ó+ˆEÛ$�Ø—‘˜tÔ*Ø×%Ñ% d¸Ñ9JÑ,KÔLØ—y‘y “�ØÓ#Ø—L‘L §z¡z£|Ô4Ø—O‘O D×*:Ñ*:Ó*<Ö=ñ %ô (Ø˜wÐ6¼¸\Ó8JóˆEð �N‰N˜5×,Ñ,Ó.×/ñ3 7ð4 �{‰{˜7Ó#Ð#ùò- Ds   Á%F,c                 ó6   • [        U R                  5       5        g r;   )Úprintr“  rc   s    r4   ÚdumpÚ_ScriptProfile.dumpý  s   € Üˆd×ÑÓ Õ!r6   )r™  ra  )rz   r{   r|   r}   rR   rœ  rŸ  rò   r“  rÁ  r~   r<   r6   r4   r–  r–  Õ  s"   † ô:òòð$˜Sô $õ<"r6   r–  c                 ó"   • U c  [        S5      eU $ )NzUnwrapping null optional)ÚAssertionError)rÖ  s    r4   Ú_unwrap_optionalrÅ    s   € Ø�yÜÐ7Ó8Ð8Ø€Hr6   zaten::_unwrap_optionalzaten::is_scriptingzaten::has_torch_functionr;   )Nr   NN)r   r£  )�r=  Úcollectionsr¯  r&  rÂ   r×  r0   rÝ   rß   Úcollections.abcr   r   r   r   Útypingr   r   r	   Útyping_extensionsr
   r   r„   Útorch._jit_internalrâ   Útorch._classesr   r   r   Útorch._utils_internalr   Útorch.jit._builtinsr   Útorch.jit._fuserr   r   Útorch.jit._monkeytype_configr   r   r   Útorch.jit._recursiver   r   r   r   Útorch.jit._stater   r   r   r   r   Útorch.jit.frontendr   r    r!   Útorch.nnr"   Útorch.overridesr#   r$   r%   Útorch.packager&   r'   Útorch.utilsr(   Ú_serializationr*   r+   r>   r…   rx  rž  r,   rz   r|   r5   Ú
__reduce__Ú
namedtupler7   r?   rC   rJ   rL   r€   r9   r›   rË   ÚWarningrÓ   rç   ré   rò   r  rþ   Ú_magic_methodsr  r.  r@  ro   r”   re  rF   rV   rB   ÚitemÚcallabler“   r  Ú
startswithrH   rÛ  Ú_compiled_methods_allowlistr  ÚmethodÚendswithr  r  r  r  r  ÚboolrN  r"  ÚtuplerÐ  r7  r^  r9  rD  rR  r[  r+  rb  rh  rø   ro  rq  r„  r–  rÅ  Úis_scriptingr<   r6   r4   Ú<module>rå     sÓ  ðòó Û Û Û Û Û Û 
Û ß AÓ Aß &Ñ &ß .ã Ý +Ý "ß >Ý 7Ý 1ß A÷ñ ÷
ó ÷õ ÷ PÑ OÝ ÷ñ ÷
 ;Ý "å 1ñ ˆTƒ]€ñ "Ó#€à":€‡�× Ñ Ô Ø$.€‡�× Ñ Ô !Ø—‘×(Ñ(€ð€Ô ð +€Ô Ø8€Ô Ù 
ˆ>˜;Ô 'ò
Að $€Ô ö Ø×&Ò& {°W¸fÐ4EÓF�IòðI€	Ô òXò$òC÷( "ñ  "ôF&'Ð*ô &'ôb;-�ô ;-÷|+ñ +ô
	�Gô 	ò+÷>(ñ (ð'Øð'Ø14ð'à
‡X�X‡_�_ô'÷0 ò€N÷>?Cñ ?CóB &ˆò	Kñ 	Ð$ k°?ÖCñ &ôTB�v¨ò TBôlU ô Uðz
 ,×4Ñ4×:Ñ:Ö<‰
ˆˆdÙ˜�~‰~¡j°°x×&@Ñ&@ÙØ�?‰?˜4× Ñ ¡G¨L¸$×$?Ñ$?Ùñ 	�˜d DÖ)ñ =ò
ò&#ÐòPñ % U§X¡X§_¡_Ö5‰ˆˆfØ�?‰?˜4× Ñ  D§M¡M°,×$?Ñ$?Ùð Ð-×6Ñ6Õ6ØÐ7Õ7áÐ)¨6¯?©?¹JÀtÓ<LÖMò 6÷ñ ô�u—x‘x—‘ô ô ô ò
$òN8ò
$ô $ð €	ˆ4Ó ð
 ØØ	ØLPñH=ð
 ˜$˜u™+ t¨H°d¸5±kÐ,AÑ'BÀDÐHÑIõH=ðZ ØØ(,ØLPñnØ	ðnàðnð ðnð �C�5˜#�:Ñ
 Ñ
%ð	nð
 ˜$˜u™+ t¨H°d¸5±kÐ,AÑ'BÀDÐHÑIðnð 	õnòjòò.ò6
ðR�2ð R˜"ô Ròj=ð —(‘(×*Ò*€Ù 
ˆ?˜KÔ (ñ@ˆ3ð @˜ð @ cð @°Sõ @÷<ñ <÷8"ñ "÷8)"ñ )"òXñ Ð"Ð$<Ô =Ù �-×,Ò,Ð.BÔ CÙ Ð$Ð&@Ô AÙ Ð*Ð,FÔ GÙ Ð-Ð/IÕ Jr6   