§
    Lzni_ó  ã            	       ó~  — d Z ddlZddlZddlZddlZddlZddlZddlZddlm	Z	m
Z
mZmZmZmZmZ ddlZddlmZ ddlmZ ddlmZ ddlmZ ddlmZmZ ddlmZmZmZ dd	lm Z m!Z!m"Z"m#Z# dd
l$m%Z%m&Z&m'Z'm(Z(m)Z) ddl*m+Z+m,Z,m-Z- ddl.m/Z/ ddl0m1Z1m2Z2m3Z3 ddl4m5Z5m6Z6 ddl7m8Z8 ddl9m:Z:  e¦   «         a;eej<        j=        _>        eej<        j?        _>        ej<        j?        Z?de?_          e8e?d¦  «         d„ Z@e@e?_A        e%r ejB        dddg¦  «        ZCnd„ ZCdeC_         d„ ZDd„ ZEd„ ZF G d„ d¦  «        ZG G d„ d eG¦  «        ZH G d!„ d"eI¦  «        ZJ G d#„ d$¦  «        ZK G d%„ d&eL¦  «        ZMd'„ ZN G d(„ d)¦  «        ZOd*e6d+ePd,ejQ        j/        fd-„ZRe%�r#g d.¢ZS G d/„ d0¦  «        ZTeSD ]ZUd1„ ZV eWeTeUeV¦  «         Œ G d2„ d3e/eJ¬4¦  «        ZX G d5„ d6eX¦  «        ZYeYjZ         [                    ¦   «         D ]L\  Z\Z] e^e]¦  «        s e_e]e`¦  «        sŒe\ a                    d7¦  «        s ebeXe\¦  «        rŒ? eWeXe\e]¦  «         ŒMd8„ Zch d9£Zdd:„ Ze ecejQ        j/        ¦  «        D ]X\  Z\Zfe\ a                    d7¦  «        se\ g                    d;¦  «        rŒ0e\eYjZ        vre\edvr eWeYefjh         eee\¦  «        ¦  «         ŒYn3 G d<„ d0¦  «        ZT G d=„ d3ejQ        j/        ¦  «        ZX G d>„ d6eX¦  «        ZYd?„ Zid@„ ZjdA„ Zkd[dB„Zl	 	 	 	 d\dCeee         ee
ee         f         df         fdD„ZmdE„ ZndF„ ZodG„ ZpdH„ ZqdI„ ZrdJ„ Zsej<        jt        Zt e8etd¦  «         d]dLePdMeudNeudOePfdP„Zv G dQ„ dR¦  «        Zw G dS„ dT¦  «        Zx G dU„ dV¦  «        ZydW„ Zz eezdX¦  «          eej{        dY¦  «          ee1dZ¦  «          ee2dZ¦  «          ee3dZ¦  «         dS )^zß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)ÚAnyÚCallableÚDictÚListÚSetÚTupleÚUnion)Úclasses)Ú_qualified_name)Ú_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_locationz†
Functionally equivalent to a :class:`ScriptModule`, but represents a single
function and does not have any attributes or Parameters.
z	torch.jitc                 ó*   — t          j        d¦  «        ‚)Nz ScriptFunction cannot be pickled©ÚpickleÚPickleError©Úclss    úq/var/www/html/cool-property-finder/image-detection-backend/venv/lib/python3.11/site-packages/torch/jit/_script.pyÚ_reducer.   D   s   € Ý
Ô
Ð?Ñ
@Ô
@Ð@ó    Ú	AttributeÚvalueÚtypec                 ó   — | S ©N© )r1   r2   s     r-   r0   r0   O   s   € Øˆr/   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):
                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):
                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                  ó   — t           S r4   )Útype_trace_dbr5   r/   r-   Ú_get_type_trace_dbr8   Ÿ   s   € åÐr/   c                 ó$   — t          | |d ¦  «        S r4   )Úgetattr)r,   Únames     r-   Ú_get_function_from_typer<   ¥   s   € Ý�3˜˜dÑ#Ô#Ð#r/   c                 óh   — t          | d¦  «        r!dt          | ¦  «        v pt          | d¦  «        S d S )NÚ	__class__Ú__dict__Ú	__slots__)ÚhasattrÚdirr+   s    r-   Ú_is_new_style_classrC   «   sA   € Ýˆs�KÑ Ô ð CØ�S ™XœXÐ%ÐB­°°kÑ)BÔ)BÐBðCð Cr/   c                   óD   — e Zd Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Z	d„ Z
d	„ Zd
S )ÚOrderedDictWrapperc                 ó   — || _         d S r4   )Ú_c)ÚselfrG   s     r-   Ú__init__zOrderedDictWrapper.__init__À   s   € ØˆŒˆˆr/   c                 ó>   — d„ |                       ¦   «         D ¦   «         S )Nc                 ó   — g | ]\  }}|‘ŒS r5   r5   ©Ú.0ÚkÚvs      r-   ú
<listcomp>z+OrderedDictWrapper.keys.<locals>.<listcomp>Ä   ó   € Ð+Ð+Ð+‘d�a˜�Ð+Ð+Ð+r/   ©Úitems©rH   s    r-   ÚkeyszOrderedDictWrapper.keysÃ   ó   € Ø+Ð+˜dŸjšj™lœlÐ+Ñ+Ô+Ð+r/   c                 ó>   — d„ |                       ¦   «         D ¦   «         S )Nc                 ó   — g | ]\  }}|‘ŒS r5   r5   rL   s      r-   rP   z-OrderedDictWrapper.values.<locals>.<listcomp>Ç   rQ   r/   rR   rT   s    r-   ÚvalueszOrderedDictWrapper.valuesÆ   rV   r/   c                 óD   — t          |                      ¦   «         ¦  «        S r4   )ÚlenrY   rT   s    r-   Ú__len__zOrderedDictWrapper.__len__É   s   € Ý�4—;’;‘=”=Ñ!Ô!Ð!r/   c                 ó    — t          d¦  «        ‚)Nz6cannot delete methods or parameters of a script module©ÚRuntimeError©rH   rN   s     r-   Ú__delitem__zOrderedDictWrapper.__delitem__Ì   s   € ÝÐSÑTÔTÐTr/   c                 ó4   — | j                              ¦   «         S r4   )rG   rS   rT   s    r-   rS   zOrderedDictWrapper.itemsÏ   s   € ØŒw�}Š}‰ŒÐr/   c                 óh   — || vrt          d|› �¦  «        ‚| j                             ||¦  «         d S )NzICan't add a new parameter after ScriptModule construction. Tried to add ')r_   rG   Úsetattr©rH   rN   rO   s      r-   Ú__setitem__zOrderedDictWrapper.__setitem__Ò   sG   € Ø�Dˆ=ˆ=ÝØ_Ð\]Ð_Ð_ñô ð ð 	Œ�Š˜˜1ÑÔÐÐÐr/   c                 ó6   — | j                              |¦  «        S r4   )rG   Úcontainsr`   s     r-   Ú__contains__zOrderedDictWrapper.__contains__Ù   s   € ØŒw×Ò Ñ"Ô"Ð"r/   c                 ó\   — || vrt          |¦  «        ‚| j                             |¦  «        S r4   )ÚKeyErrorrG   r:   r`   s     r-   Ú__getitem__zOrderedDictWrapper.__getitem__Ü   s+   € Ø�Dˆ=ˆ=Ý˜1‘+”+ÐØŒw�Š˜qÑ!Ô!Ð!r/   N)Ú__name__Ú
__module__Ú__qualname__rI   rU   rY   r\   ra   rS   rf   ri   rl   r5   r/   r-   rE   rE   ¿   sž   € € € € € ðð ð ð,ð ,ð ,ð,ð ,ð ,ð"ð "ð "ðUð Uð Uðð ð ðð ð ð#ð #ð #ð"ð "ð "ð "ð "r/   rE   c                   ó6   ‡ — e Zd Zˆ fd„Zd„ Zd„ Zd„ Zd„ Zˆ xZS )ÚOrderedModuleDictc                 ó’   •— t          ¦   «                              t          j                             |¦  «        ¦  «         || _        d S r4   )ÚsuperrI   ÚtorchÚ_CÚ
ModuleDictÚ_python_modules)rH   ÚmoduleÚpython_dictr>   s      €r-   rI   zOrderedModuleDict.__init__ã   s;   ø€ Ý‰Œ×Ò�œ×,Ò,¨VÑ4Ô4Ñ5Ô5Ð5ð  +ˆÔÐÐr/   c                 ó8   — | j                              ¦   «         }|S r4   )rw   rS   ©rH   Úrs     r-   rS   zOrderedModuleDict.itemsí   s   € ØÔ ×&Ò&Ñ(Ô(ˆØˆr/   c                 ó   — || j         v S r4   ©rw   r`   s     r-   ri   zOrderedModuleDict.__contains__ñ   s   € Ø�DÔ(Ð(Ð(r/   c                 ó¤   — t          |t          ¦  «        r'| j                             ||¦  «         || j        |<   d S t          d|› d|› �¦  «        ‚)NzgCannot re-assign modules in a ScriptModule with non-scripted module, tried to replace existing module 'z': )Ú
isinstanceÚScriptModulerG   rd   rw   r_   re   s      r-   rf   zOrderedModuleDict.__setitem__ô   su   € õ �a�Ñ&Ô&ð 	ØŒG�OŠO˜A˜qÑ!Ô!Ð!Ø&'ˆDÔ  Ñ#Ð#Ð#åðGØ=>ðGð GØCDðGð Gñô ð r/   c                 ó   — | j         |         S r4   r~   r`   s     r-   rl   zOrderedModuleDict.__getitem__  s   € ØÔ# AÔ&Ð&r/   )	rm   rn   ro   rI   rS   ri   rf   rl   Ú__classcell__©r>   s   @r-   rq   rq   â   st   ø€ € € € € ð+ð +ð +ð +ð +ðð ð ð)ð )ð )ðð ð ð&'ð 'ð 'ð 'ð 'ð 'ð 'r/   rq   c                   ó   ‡ — e Zd Zˆ fd„Zˆ xZS )Ú
ScriptMetac                 óB  •‡ ‡	— i ‰ _         t          t          ‰ dd¦  «        ¦  «        ‰ _        t	          |¦  «        D ]q}t          |di ¦  «                             ¦   «         D ]\  }}|‰ j         |<   Œt          |dt          ¦   «         ¦  «        }‰ j                             |¦  «        ‰ _        Œrt          |                     ¦   «         ¦  «        D ]>\  }}t          |t          ¦  «        r$t          ‰ |¦  «         |‰ j         |j        j        <   Œ?t          ‰ dd¦  «        r#t          ¦   «                              |||¦  «        S t          ‰ dd„ ¦  «        Š	t          j        ‰	¦  «        ˆ ˆ	fd	„¦   «         }|‰ _        t          ¦   «                              |||¦  «         d S )
NÚ__constants__r5   Ú_methodsÚ_constants_setÚ_disable_script_metaFrI   c                 ó   — d S r4   r5   rT   s    r-   ú<lambda>z%ScriptMeta.__init__.<locals>.<lambda>*  s   € ¸d€ r/   c                 óì  •— t          ‰	j        ¦  «        } ‰
| g|¢R i |¤Ž t          ‰	j        ¦  «        |k    }t          | ¦  «        ‰	k    r¥d„ }t          j        j                             | || ¬¦  «        | j        d<   | j        j	        }| 
                    ¦   «         D ]}t          | |¦  «         Œ|                     ¦   «         D ]\  }}t          | |¦  «         ŒdD ]}t          | |¦  «         Œd S d S )Nc                 ó¾   — t          | ¦  «        }t          |d¦  «        r0d„ t          |j                             ¦   «         ¦  «        D ¦   «         S t          | ¦  «        S )Nr‰   c                 ó   — g | ]\  }}|‘ŒS r5   r5   rL   s      r-   rP   zUScriptMeta.__init__.<locals>.init_then_script.<locals>.make_stubs.<locals>.<listcomp>7  s   € ÐKÐKÐK¡d a¨ ÐKÐKÐKr/   )r2   rA   Úsortedr‰   rS   r   )rx   r,   s     r-   Ú
make_stubszAScriptMeta.__init__.<locals>.init_then_script.<locals>.make_stubs4  sX   € Ý˜v™,œ,�CÝ˜s JÑ/Ô/ð @ØKÐK­f°S´\×5GÒ5GÑ5IÔ5IÑ.JÔ.JÐKÑKÔKÐKå7¸Ñ?Ô?Ð?r/   )Úshare_typesÚ_actual_script_module)Ú_parametersÚ_buffersÚ_modules)r[   r‰   r2   rt   ÚjitÚ
_recursiveÚcreate_script_moduler?   r”   Ú_concrete_typeÚget_attributesÚdelattrÚget_modules)rH   ÚargsÚkwargsÚnum_methodsÚadded_methods_in_initr’   Úconcrete_typer;   Ú_r,   Úoriginal_inits            €€r-   Úinit_then_scriptz-ScriptMeta.__init__.<locals>.init_then_script,  sD  ø€ å˜cœlÑ+Ô+ˆKØˆM˜$Ð0 Ð0Ð0Ð0¨Ð0Ð0Ð0Ý$'¨¬Ñ$5Ô$5¸Ò$CÐ!å�D‰zŒz˜SÒ Ð ð@ð @ð @õ ”IÔ(×=Ò=Ø˜*Ð6KÐ2Kð >ñ ô ð ”Ø+ñð !%Ô :Ô I�Ø)×8Ò8Ñ:Ô:ð (ð (�DÝ˜D $Ñ'Ô'Ð'Ð'Ø,×8Ò8Ñ:Ô:ð (ð (‘G�D˜!Ý˜D $Ñ'Ô'Ð'Ð'ØCð (ð (�DÝ˜D $Ñ'Ô'Ð'Ð'ð1 !Ð ð.(ð (r/   )r‰   Úsetr:   rŠ   ÚreversedrS   Úunionr‘   r€   r   r�   Úoriginal_methodrm   rs   rI   Ú	functoolsÚwraps)r,   r;   ÚbasesÚattrsÚbaserN   rO   Úbase_constantsr¦   r¥   r>   s   `        @€r-   rI   zScriptMeta.__init__  s§  øøø€ à')ˆŒÝ ¥¨¨o¸rÑ!BÔ!BÑCÔCˆÔÝ˜U‘O”Oð 	Jð 	JˆDÝ  j°"Ñ5Ô5×;Ò;Ñ=Ô=ð $ð $‘��1Ø"#�”˜Q‘�Ý")¨$Ð0@Å#Á%Ä%Ñ"HÔ"HˆNØ!$Ô!3×!9Ò!9¸.Ñ!IÔ!IˆCÔÐõ ˜5Ÿ;š;™=œ=Ñ)Ô)ð 	=ð 	=‰DˆAˆqÝ˜!Õ-Ñ.Ô.ð =Ý˜˜Q‘”�Ø;<�”˜QÔ.Ô7Ñ8øå�3Ð.°Ñ6Ô6ð 	8õ ‘7”7×#Ò# D¨%°Ñ7Ô7Ð7å  ZÐ1BÐ1BÑCÔCˆå	Œ˜Ñ	'Ô	'ð	(ð 	(ð 	(ð 	(ð 	(ñ 
(Ô	'ð	(ð> (ˆŒÝ‰Œ×Ò˜˜u eÑ,Ô,Ð,Ð,Ð,r/   ©rm   rn   ro   rI   rƒ   r„   s   @r-   r†   r†     s8   ø€ € € € € ð9-ð 9-ð 9-ð 9-ð 9-ð 9-ð 9-ð 9-ð 9-r/   r†   c                   ó   — e Zd Zd„ ZdS )Ú_CachedForwardc                 ó,   — |                       d¦  «        S )NÚforward)Ú__getattr__)rH   Úobjr,   s      r-   Ú__get__z_CachedForward.__get__Q  s   € Ø×Ò 	Ñ*Ô*Ð*r/   N)rm   rn   ro   r¸   r5   r/   r-   r³   r³   P  s#   € € € € € ð+ð +ð +ð +ð +r/   r³   c                   ó   — e Zd ZdS )ÚScriptWarningN©rm   rn   ro   r5   r/   r-   rº   rº   U  s   € € € € € Ø€Dr/   rº   c                 óŽ   — t           s| S t          j        d¬¦  «        }t          | | j        d¬¦  «        }t          ||| ¦  «        S )Né   ©Ú	frames_upr�   )Ú	self_name)r   Ú_jit_internalÚ!createResolutionCallbackFromFramer   rm   r   )ÚfnÚ_rcbÚasts      r-   Úscript_methodrÆ   Y  sL   € Ýð Øˆ	õ Ô:ÀQÐGÑGÔG€DÝ
�b˜"œ+°Ð
@Ñ
@Ô
@€CÝ˜D # rÑ*Ô*Ð*r/   c                   ó   — e Zd Zd„ Zd„ ZdS )ÚConstMapc                 ó   — || _         d S r4   ©Úconst_mapping)rH   rË   s     r-   rI   zConstMap.__init__n  s   € Ø*ˆÔÐÐr/   c                 ó   — | j         |         S r4   rÊ   )rH   Úattrs     r-   r¶   zConstMap.__getattr__q  s   € ØÔ! $Ô'Ð'r/   N)rm   rn   ro   rI   r¶   r5   r/   r-   rÈ   rÈ   m  s2   € € € € € ð+ð +ð +ð(ð (ð (ð (ð (r/   rÈ   ÚimporterÚscript_module_idÚreturnc                 ó@  — t          | j        t          j        j        ¦  «        st          d¦  «        ‚t          j                             ¦   «         }t          j                             || j        | j        t          | j
        ¦  «        |¦  «        }t          |¦  «        S )z»
    Called 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_readerrt   ru   ÚPyTorchFileReaderr_   ÚCompilationUnitÚ_import_ir_module_from_packageÚstorage_contextr&   Úlast_map_locationr   )rÎ   rÏ   ÚcuÚ
cpp_modules       r-   Úunpackage_script_modulerÚ   u  s’   € õ �hÔ)­5¬8Ô+EÑFÔFð 
ÝðNñ
ô 
ð 	
õ 
Œ×	!Ò	!Ñ	#Ô	#€BÝ”×8Ò8Ø
ØÔØÔ Ý˜hÔ8Ñ9Ô9Øñô €Jõ ˜:Ñ&Ô&Ð&r/   )Ú__iter__r\   Ú__neg__Ú__mul__ri   Ú__add__Ú__sub__Ú__pow__Ú__truediv__Ú__mod__Ú__ne__Ú__eq__Ú__lt__Ú__gt__Ú__le__Ú__ge__Ú__and__Ú__or__Ú__xor__rl   rf   Ú__call__Ú__int__Ú	__float__Ú__bool__Ú__str__Ú	__enter__Ú__exit__c                   óH   ‡ — e Zd ZdZˆ fd„Zˆ fd„Zˆ fd„Zd„ Zd„ Zd„ Z	ˆ xZ
S )ÚRecursiveScriptClassa  
        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          ¦   «                              ¦   «          d| j        d<   || _        d„ | j                             ¦   «         D ¦   «         | _        d| j        d<   d S )NTÚ_initializingc                 óN   — i | ]"}|j         t          |j        |j        ¦  «        “Œ#S r5   )r;   ÚpropertyÚgetterÚsetter)rM   Úprops     r-   ú
<dictcomp>z1RecursiveScriptClass.__init__.<locals>.<dictcomp>¿  s:   € ð ð ð àð ”	�8 D¤K°´Ñ=Ô=ðð ð r/   F)rs   rI   r?   rG   Ú_propertiesÚ_props)rH   Ú	cpp_classr>   s     €r-   rI   zRecursiveScriptClass.__init__¹  sn   ø€ Ý‰GŒG×ÒÑÔÐØ-1ˆDŒM˜/Ñ*ØˆDŒGðð à œG×/Ò/Ñ1Ô1ðñ ô ˆDŒKð
 .3ˆDŒM˜/Ñ*Ð*Ð*r/   c                 óì   •— d| j         v r.| j         d         r!t          ¦   «                              |¦  «        S || j        v r| j        |                              ¦   «         S t          | j        |¦  «        S ©Nrö   )r?   rs   r¶   rþ   Úfgetr:   rG   ©rH   rÍ   r>   s     €r-   r¶   z RecursiveScriptClass.__getattr__Æ  sl   ø€ Ø $¤-Ð/Ð/°D´MÀ/Ô4RÐ/Ý‘w”w×*Ò*¨4Ñ0Ô0Ð0à�t”{Ð"Ð"Ø”{ 4Ô(×-Ò-Ñ/Ô/Ð/å˜4œ7 DÑ)Ô)Ð)r/   c                 óö   •— d| j         v r/| j         d         r"t          ¦   «                              ||¦  «        S || j        v r | j        |                              |¦  «        S t          | j        ||¦  «         d S r  )r?   rs   Ú__setattr__rþ   Úfsetrd   rG   ©rH   rÍ   r1   r>   s      €r-   r  z RecursiveScriptClass.__setattr__Ï  sx   ø€ Ø $¤-Ð/Ð/°D´MÀ/Ô4RÐ/Ý‘w”w×*Ò*¨4°Ñ7Ô7Ð7à�t”{Ð"Ð"Ø”{ 4Ô(×-Ò-¨eÑ4Ô4Ð4å�D”G˜T 5Ñ)Ô)Ð)Ð)Ð)r/   c                 óŒ   — | j                              |¦  «        st          ¦   «         ‚|                      |¦  «        } ||i |¤ŽS r4   )rG   Ú_has_methodÚ	TypeErrorr¶   ©rH   Úmethod_namerŸ   r    Úself_methods        r-   Úforward_magic_methodz)RecursiveScriptClass.forward_magic_methodÚ  sL   € Ø”7×&Ò& {Ñ3Ô3ð "Ý‘k”kÐ!à×*Ò*¨;Ñ7Ô7ˆKØ�; Ð/¨Ð/Ð/Ð/r/   c                 ó*   — t          j        d¦  «        ‚)NzScriptClasses cannot be pickledr(   rT   s    r-   Ú__getstate__z!RecursiveScriptClass.__getstate__á  s   € ÝÔ$Ð%FÑGÔGÐGr/   c                 óŽ   — | j                              d¦  «        r|                      d|¦  «        S |                      d|¦  «        S )NÚ__iadd__rÞ   )rG   r	  r  )rH   Úothers     r-   r  zRecursiveScriptClass.__iadd__ä  sG   € ØŒw×"Ò" :Ñ.Ô.ð CØ×0Ò0°¸UÑCÔCÐCà×0Ò0°¸EÑBÔBÐBr/   )rm   rn   ro   Ú__doc__rI   r¶   r  r  r  r  rƒ   r„   s   @r-   rô   rô   ¬  s«   ø€ € € € € ð
	ð 
	ð	3ð 	3ð 	3ð 	3ð 	3ð	*ð 	*ð 	*ð 	*ð 	*ð	*ð 	*ð 	*ð 	*ð 	*ð	0ð 	0ð 	0ð	Hð 	Hð 	Hð	Cð 	Cð 	Cð 	Cð 	Cð 	Cð 	Cr/   rô   c                 ó.   —  | j         t          g|¢R i |¤ŽS r4   )r  r  ©rH   rŸ   r    s      r-   Úmethod_templater  ì  s%   € Ø,�4Ô,­[ÐJ¸4ÐJÐJÐJÀ6ÐJÐJÐJr/   c                   ó†   ‡ — e Zd ZU dZg d¢Zˆ fd„Z e¦   «         Zede	f         e
d<   ˆ fd„Zˆ fd„Zd„ Zd	„ Zd
efd„Zˆ xZS )r�   zÚ
        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_namec                 óH   •— t          ¦   «                              ¦   «          d S r4   ©rs   rI   )rH   r>   s    €r-   rI   zScriptModule.__init__  ó   ø€ Ý‰GŒG×ÒÑÔÐÐÐr/   .rµ   c                 ó‚   •— d| j         vr!t          ¦   «                              |¦  «        S t          | j        |¦  «        S )Nr”   )r?   rs   r¶   r:   r”   r  s     €r-   r¶   zScriptModule.__getattr__  s;   ø€ Ø&¨d¬mÐ;Ð;Ý‘w”w×*Ò*¨4Ñ0Ô0Ð0Ý˜4Ô5°tÑ<Ô<Ð<r/   c                 ó  •— d| j         vrgt          |t          ¦  «        r0d| j        j         vri | j        _        |j        | j        |<   |j        }t          ¦   «                              ||¦  «        S t          | j
        ||¦  «         d S )Nr”   Ú__annotations__)r?   r€   r0   r>   r#  r2   r1   rs   r  rd   r”   r  s      €r-   r  zScriptModule.__setattr__  s‹   ø€ Ø&¨d¬mÐ;Ð;õ ˜e¥YÑ/Ô/ð (ð
 )°´Ô0GÐGÐGØ9;˜œÔ6Ø16´�DÔ(¨Ñ.Ø!œK�EÝ‘w”w×*Ò*¨4°Ñ7Ô7Ð7å�DÔ.°°eÑ<Ô<Ð<Ð<Ð<r/   c                 ó  — d| j         v r| j                             |¦  «        S t          j        d¬¦  «        }t
          j                             |¦  «        }t          ||d ¦  «        | j	        | 
                    ¦   «         j
        <   d S )Nr”   r%   r¾   )r?   r”   ÚdefinerÁ   rÂ   rt   ru   Ú_parse_source_defr   r‰   r;   )rH   ÚsrcÚrcbrÅ   s       r-   r%  zScriptModule.define%  sz   € Ø&¨$¬-Ð7Ð7ð Ô1×8Ò8¸Ñ=Ô=Ð=õ  ÔAÈAÐNÑNÔNˆCÝ”(×,Ò,¨SÑ1Ô1ˆCÝ-=¸cÀ3ÈÑ-MÔ-MˆDŒM˜#Ÿ(š(™*œ*œ/Ñ*Ð*Ð*r/   c                 ó4   — | j                              ¦   «         S r4   )r”   Ú_replicate_for_data_parallelrT   s    r-   r*  z)ScriptModule._replicate_for_data_parallel;  s   € ØÔ-×JÒJÑLÔLÐLr/   Úexporterc                 ó˜   — |                      ¦   «         }|j                             | j        t	          |¦  «        ¦  «         t
          |ffS )a}  
            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Ú	serializerG   ÚintrÚ   )rH   r+  rÏ   s      r-   Ú__reduce_package__zScriptModule.__reduce_package__>  sI   € ð  (×5Ò5Ñ7Ô7ÐØÔ-×7Ò7¸¼ÅÐEUÑAVÔAVÑWÔWÐWÝ+Ð.>Ð-@ÐAÐAr/   )rm   rn   ro   r  Ú__jit_unused_properties__rI   r³   rµ   r   r   r#  r¶   r  r%  r*  r"   r1  rƒ   r„   s   @r-   r�   r�   ù  só   ø€ € € € € € ð	ð 	ð
%
ð %
ð %
Ð!ð	ð 	ð 	ð 	ð 	ð '5 nÑ&6Ô&6ˆ�˜#˜s˜(Ô#Ð6Ð6Ñ6ð	=ð 	=ð 	=ð 	=ð 	=ð
	=ð 	=ð 	=ð 	=ð 	=ð(	Nð 	Nð 	Nð,	Mð 	Mð 	Mð	B¨ð 	Bð 	Bð 	Bð 	Bð 	Bð 	Bð 	Bð 	Br/   r�   )Ú	metaclassc                   óJ  ‡ — e Zd ZdZdZˆ fd„Zed„ ¦   «         Zed„ ¦   «         Zd„ Z	e
d„ ¦   «         Ze
d„ ¦   «         Ze
d	„ ¦   «         Ze
d
„ ¦   «         Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Ze
d„ ¦   «         Zd„ Zˆ fd„Zˆ fd„Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Z ˆ fd„Z!d„ Z"d„ Z#ˆ xZ$S ) ÚRecursiveScriptModulea#  
        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| j         d<   || _        t          ¦   «                              ¦   «          t	          | d¦  «         d S )NTrö   Útraining)r?   rG   rs   rI   r�   )rH   rÙ   r>   s     €r-   rI   zRecursiveScriptModule.__init__g  sD   ø€ Ø-1ˆDŒM˜/Ñ*Ø ˆDŒGÝ‰GŒG×ÒÑÔÐõ �D˜*Ñ%Ô%Ð%Ð%Ð%r/   c                 ón   — t          | ¦  «        } ||¦  «         t                                |¦  «         |S )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.
            )r5  Ú_finalize_scriptmodule)rÙ   Úinit_fnÚscript_modules      r-   Ú
_constructz RecursiveScriptModule._constructp  s=   € õ 2°*Ñ=Ô=ˆMØˆG�MÑ"Ô"Ð"õ "×8Ò8¸ÑGÔGÐGØ Ð r/   c                 ó*  — t          t          j                             | j        ¦  «        ¦  «        | _        t          t          j                             | j        ¦  «        ¦  «        | _        t          | j        | j	        ¦  «        | _	        d| _
        d S )NF)rE   rt   ru   ÚParameterDictrG   r•   Ú
BufferDictr–   rq   r—   rö   ©r;  s    r-   r9  z,RecursiveScriptModule._finalize_scriptmodule†  sƒ   € å(:Ý”×&Ò& }Ô'7Ñ8Ô8ñ)ô )ˆMÔ%õ &8Ý”×#Ò# MÔ$4Ñ5Ô5ñ&ô &ˆMÔ"õ &7ØÔ  -Ô"8ñ&ô &ˆMÔ"ð +0ˆMÔ'Ð'Ð'r/   c                 óÀ  — |                       |¦  «         t          j        j                             | j                             ¦   «         ¦  «        | _        i }t          j                             | j        ¦  «         	                    ¦   «         D ]\  }}t          |¦  «        ||<   Œt          | j        |¦  «        | _        t          t          j                             | j        ¦  «        ¦  «        | _        t          t          j                             | j        ¦  «        ¦  «        | _        d„ | j         	                    ¦   «         D ¦   «         | _        d| j        d<   dS )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.
            c                 óX   — i | ]'\  }}t          |t          j        j        ¦  «        °$||“Œ(S r5   )r€   rt   ru   ÚScriptMethodrL   s      r-   rü   z6RecursiveScriptModule._reconstruct.<locals>.<dictcomp>¬  sC   € ð ð ð á�A�qÝ! !¥U¤XÔ%:Ñ;Ô;ðØ�1ðð ð r/   Frö   N)rI   rt   ru   ÚConcreteModuleTypeÚfrom_jit_typerG   Ú_typer›   rv   rS   r   rq   r—   rE   r>  r•   r?  r–   r?   )rH   rÙ   Úmodulesr;   s       r-   Ú_reconstructz"RecursiveScriptModule._reconstruct“  s(  € ð �MŠM˜*Ñ%Ô%Ð%õ #(¤(Ô"=×"KÒ"KØ”—’‘”ñ#ô #ˆDÔð
 ˆGÝ$)¤H×$7Ò$7¸¼Ñ$@Ô$@×$FÒ$FÑ$HÔ$Hð <ð <Ñ ��jÝ /°
Ñ ;Ô ;�˜‘�Ý-¨d¬g°wÑ?Ô?ˆDŒMõ  2µ%´(×2HÒ2HÈÌÑ2QÔ2QÑRÔRˆDÔÝ.­u¬x×/BÒ/BÀ4Ä7Ñ/KÔ/KÑLÔLˆDŒMðð à œM×/Ò/Ñ1Ô1ðñ ô ˆDŒMð
 .3ˆDŒM˜/Ñ*Ð*Ð*r/   c                 ó@   — | j                              d¦  «        j        S )z£
            Returns a string representation of the internal graph for the
            ``forward`` method. See :ref:`interpreting-graphs` for details.
            rµ   )rG   Ú_get_methodr  rT   s    r-   r  zRecursiveScriptModule.graph³  s   € ð ”7×&Ò& yÑ1Ô1Ô7Ð7r/   c                 ó   — | j         j        S )zø
            Returns a string representation of the internal graph for the
            ``forward`` method. This graph will be preprocessed to inline all function and method calls.
            See :ref:`interpreting-graphs` for details.
            )rµ   r  rT   s    r-   r  z#RecursiveScriptModule.inlined_graph»  s   € ð ”<Ô-Ð-r/   c                 ó   — | j         j        S )zÌ
            Returns a pretty-printed representation (as valid Python syntax) of
            the internal graph for the ``forward`` method. See
            :ref:`inspecting-code` for details.
            )rµ   r  rT   s    r-   r  zRecursiveScriptModule.codeÄ  s   € ð ”<Ô$Ð$r/   c                 óT   — | j         j        }|d         t          |d         ¦  «        fS )a   
            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.

            See :ref:`inspecting-code` for details.
            r   r%   )rµ   r  rÈ   r{   s     r-   r  z)RecursiveScriptModule.code_with_constantsÍ  s'   € ð ”Ô0ˆAØ�a”D�( 1 Q¤4™.œ.Ð)Ð)r/   c                 óB   —  | j         j        t          |¦  «        fi |¤ŽS )aO  
            save(f, _extra_files={})

            See :func:`torch.jit.save <torch.jit.save>` witch 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.
            )rG   ÚsaveÚstr)rH   Úfr    s      r-   rO  zRecursiveScriptModule.saveÜ  s&   € ð  �4”7”<¥ A¡¤Ð1Ð1¨&Ð1Ð1Ð1r/   c                 ó&   —  | j         j        |i |¤ŽS )az  
            _save_for_lite_interpreter(f)

            Add (or update) the bytecode session to the script model. 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'.

            )rG   Ú_save_for_mobiler  s      r-   Ú_save_for_lite_interpreterz0RecursiveScriptModule._save_for_lite_interpreteræ  s   € ð ,�4”7Ô+¨TÐ<°VÐ<Ð<Ð<r/   c                 ó&   —  | j         j        |i |¤ŽS r4   )rG   Ú_save_to_buffer_for_mobiler  s      r-   Ú$_save_to_buffer_for_lite_interpreterz:RecursiveScriptModule._save_to_buffer_for_lite_interpreterô  s   € Ø5�4”7Ô5°tÐF¸vÐFÐFÐFr/   c                 ó&   —  | j         j        |i |¤ŽS r4   )rG   Úsave_to_bufferr  s      r-   rY  z$RecursiveScriptModule.save_to_buffer÷  s   € Ø)�4”7Ô)¨4Ð:°6Ð:Ð:Ð:r/   c                 ó4   — | j                              ¦   «         S r4   )rG   Úget_debug_stater  s      r-   r[  z%RecursiveScriptModule.get_debug_stateú  s   € Ø”7×*Ò*Ñ,Ô,Ð,r/   c                 ó   — d| j         › �S )Nzoriginal_name=)r  rT   s    r-   Ú
extra_reprz RecursiveScriptModule.extra_reprý  s   € Ø8 DÔ$6Ð8Ð8Ð8r/   c                 ó.   —  | j         j        | g|¢R i |¤ŽS r4   )rµ   Ú	graph_forr  s      r-   r_  zRecursiveScriptModule.graph_for   s'   € Ø)�4”<Ô)¨$Ð@°Ð@Ð@Ð@¸Ð@Ð@Ð@r/   c                 ó  — t          | ¦  «        t          | j                             ¦   «                              ¦   «         ¦  «        k    rdS t          | j                             ¦   «                              ¦   «         ¦  «        S )NÚ )r2   rP  rG   rF  r;   rT   s    r-   r  z#RecursiveScriptModule.original_name  sZ   € å�D‰zŒz�S ¤§¢¡¤×!5Ò!5Ñ!7Ô!7Ñ8Ô8Ò8Ð8Ø�rÝ�t”w—}’}‘”×+Ò+Ñ-Ô-Ñ.Ô.Ð.r/   c                 ór   — t          j        d¬¦  «        }| j                             | j        ||¦  «         d S )Nr%   r¾   )rÁ   rÂ   rG   Ú_definer›   )rH   r'  r(  s      r-   r%  zRecursiveScriptModule.define	  s8   € õ  ÔAÈAÐNÑNÔNˆCØŒG�OŠO˜DÔ/°°cÑ:Ô:Ð:Ð:Ð:r/   c                 óÚ  •— d| j         vrt          d¦  «        ‚| j        r!t          ¦   «                              |¦  «        S || j        v r| j        |         S | j                             |¦  «        r| j                             |¦  «        S | j         	                    |¦  «        r&| j         
                    |¦  «        }|| j         |<   |S t          ¦   «                              |¦  «        S )Nrö   zKScriptModule has not been initialized, did you forget to call super's init?)r?   r_   rö   rs   r¶   r—   rG   rA   r:   r	  rJ  )rH   rÍ   rÆ   r>   s      €r-   r¶   z!RecursiveScriptModule.__getattr__  sé   ø€ Ø d¤mÐ3Ð3Ý"Øañô ð ð Ô!ð 1Ý‘w”w×*Ò*¨4Ñ0Ô0Ð0ð �t”}Ð$Ð$Ø”} TÔ*Ð*Ø”—’ Ñ&Ô&ð %Ø”w—’ tÑ,Ô,Ð,Ø”×$Ò$ TÑ*Ô*ð %Ø $¤× 3Ò 3°DÑ 9Ô 9�ð '4�”˜dÑ#Ø$Ð$å‘7”7×&Ò& tÑ,Ô,Ð,r/   c                 óØ  •— | j         r"t          ¦   «                              ||¦  «        S || j        v r|| j        |<   d S | j                             |¦  «        r| j                             ||¦  «         d S t          | d¦  «        rC|| j                             ¦   «          	                    ¦   «         v rt          d|› d|› d�¦  «        ‚t          ¦   «                              ||¦  «        S )Nr›   z+Cannot mutate TorchScript constant value: 'z'. Value: 'ú')rö   rs   r  r—   rG   rA   rd   r›   Úget_constantsrU   ÚAttributeErrorr  s      €r-   r  z!RecursiveScriptModule.__setattr__-  sù   ø€ ØÔ!ð 8Ý‘w”w×*Ò*¨4°Ñ7Ô7Ð7à�t”}Ð$Ð$Ø&+�”˜dÑ#Ð#Ð#Ø”—’ Ñ&Ô&ð 8Ø”—’  eÑ,Ô,Ð,Ð,Ð,å˜Ð.Ñ/Ô/ð8à˜DÔ/×=Ò=Ñ?Ô?×DÒDÑFÔFÐFÐFõ %Ø[À$Ð[Ð[ÐSXÐ[Ð[Ð[ñô ð õ ‘w”w×*Ò*¨4°Ñ7Ô7Ð7r/   c                 óx   — t           j        j                             t	          j        | j        ¦  «        ¦  «        S r4   )rt   r˜   r™   r   ÚcopyrG   rT   s    r-   Ú__copy__zRecursiveScriptModule.__copy__H  s'   € Ý”9Ô'×7Ò7½¼	À$Ä'Ñ8JÔ8JÑKÔKÐKr/   c                 óz   — t           j        j                             t	          j        | j        |¦  «        ¦  «        S r4   )rt   r˜   r™   r   rj  ÚdeepcopyrG   )rH   Úmemos     r-   Ú__deepcopy__z"RecursiveScriptModule.__deepcopy__K  s)   € Ý”9Ô'×7Ò7½¼ÀdÄgÈtÑ8TÔ8TÑUÔUÐUr/   c                 óž   — t          | |¦  «        }t          |dd ¦  «        t          t          |¦  «        k    rt          ¦   «         ‚ ||i |¤ŽS )NÚ__func__)r:   r5  ÚNotImplementedErrorr  s        r-   r  z*RecursiveScriptModule.forward_magic_methodR  s^   € Ý! $¨Ñ4Ô4ˆKÝ�{ J°Ñ5Ô5½Ý% {ñ:ô :ò ð õ *Ñ+Ô+Ð+Ø�; Ð/¨Ð/Ð/Ð/r/   c                 ó,   — |                       d¦  «        S )NrÛ   ©r  rT   s    r-   rÛ   zRecursiveScriptModule.__iter__Z  s   € Ø×,Ò,¨ZÑ8Ô8Ð8r/   c                 ó.   — |                       d|¦  «        S )Nrl   rt  )rH   Úidxs     r-   rl   z!RecursiveScriptModule.__getitem__]  s   € Ø×,Ò,¨]¸CÑ@Ô@Ð@r/   c                 ó,   — |                       d¦  «        S )Nr\   rt  rT   s    r-   r\   zRecursiveScriptModule.__len__`  s   € Ø×,Ò,¨YÑ7Ô7Ð7r/   c                 ó.   — |                       d|¦  «        S )Nri   rt  )rH   Úkeys     r-   ri   z"RecursiveScriptModule.__contains__c  s   € Ø×,Ò,¨^¸SÑAÔAÐAr/   c                 ó¢   •— | j         }|j        t          t          d¦  «        k    r t	          ¦   «                               ¦   «         S  |¦   «         S )NÚ__dir__)r{  rq  r<   r5  rs   )rH   r  r>   s     €r-   r{  zRecursiveScriptModule.__dir__h  sL   ø€ Øœ,ˆKàÔ$Ý*Õ+@À)ÑLÔLòMð Mõ ‘w”w—’Ñ(Ô(Ð(Ø�;‘=”=Ð r/   c                 ód   — | j         }|j        t          t          d¦  «        k    rdS  |¦   «         S )Nrï   T)rï   rq  r<   r5  )rH   r  s     r-   rï   zRecursiveScriptModule.__bool__t  s<   € Øœ-ˆKàÔ$Ý*Õ+@À*ÑMÔMòNð Nð �tØ�;‘=”=Ð r/   c                 ól   — d„ }t                                | j                             ¦   «         |¦  «        S )Nc                 ó   — d S r4   r5   r@  s    r-   r:  zCRecursiveScriptModule._replicate_for_data_parallel.<locals>.init_fn€  s   € à�r/   )r5  r<  rG   r*  )rH   r:  s     r-   r*  z2RecursiveScriptModule._replicate_for_data_parallel}  s>   € ðð ð õ )×3Ò3Ø”×4Ò4Ñ6Ô6¸ñô ð r/   )%rm   rn   ro   r  r‹   rI   Ústaticmethodr<  r9  rH  rø   r  r  r  r  rO  rT  rW  rY  r[  r]  r_  r  r%  r¶   r  rk  ro  r  rÛ   rl   r\   ri   r{  rï   r*  rƒ   r„   s   @r-   r5  r5  K  ss  ø€ € € € € ð	ð 	ð,  $Ðð	&ð 	&ð 	&ð 	&ð 	&ð 
ð	!ð 	!ñ 
Œð	!ð* 
ð
	0ð 
	0ñ 
Œð
	0ð	3ð 	3ð 	3ð@ 
ð	8ð 	8ñ 
Œð	8ð 
ð	.ð 	.ñ 
Œð	.ð 
ð	%ð 	%ñ 
Œð	%ð 
ð	*ð 	*ñ 
Œð	*ð	2ð 	2ð 	2ð	=ð 	=ð 	=ð	Gð 	Gð 	Gð	;ð 	;ð 	;ð	-ð 	-ð 	-ð	9ð 	9ð 	9ð	Að 	Að 	Að 
ð	/ð 	/ñ 
Œð	/ð

	;ð 
	;ð 
	;ð	-ð 	-ð 	-ð 	-ð 	-ð0	8ð 	8ð 	8ð 	8ð 	8ð6	Lð 	Lð 	Lð	Vð 	Vð 	Vð	0ð 	0ð 	0ð	9ð 	9ð 	9ð	Að 	Að 	Að	8ð 	8ð 	8ð	Bð 	Bð 	Bð
	!ð 	!ð 	!ð 	!ð 	!ð	!ð 	!ð 	!ð		ð 		ð 		ð 		ð 		ð 		ð 		r/   r5  Ú__c                 ó6   ‡— dd l Š ‰j        | ˆfd„¬¦  «        S )Nr   c                 óD   •—  ‰j         | ¦  «        p ‰j        | ¦  «        S r4   )Ú
isfunctionÚismethod)ÚxÚinspects    €r-   r�   z_get_methods.<locals>.<lambda>œ  s(   ø€ Ð%7 WÔ%7¸Ñ%:Ô%:Ð%QÐ>N¸gÔ>NÈqÑ>QÔ>Q€ r/   )Ú	predicate)r†  Ú
getmembers)r,   r†  s    @r-   Ú_get_methodsr‰  —  s9   ø€ Øˆˆˆð "ˆwÔ!ØÐQÐQÐQÐQð
ñ 
ô 
ð 	
r/   >%   ÚtoÚcpuÚcudaÚevalÚhalfr2   ÚapplyÚfloatÚtrainÚ_applyÚdoubleÚbuffersrµ   rG  Ú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                 ó   ‡ — ˆ fd„}|S )Nc                 ó(   •— t          ‰dz   ¦  «        ‚)Nz" is not supported on ScriptModulesr^   )rH   rŸ   r    r;   s      €r-   Úfailz_make_fail.<locals>.failÈ  s   ø€ Ý˜tÐ&JÑJÑKÔKÐKr/   r5   )r;   r­  s   ` r-   Ú
_make_failr®  Ç  s(   ø€ ð	Lð 	Lð 	Lð 	Lð 	Lð ˆr/   Ú
_call_implc                   ó   — e Zd ZdS )rô   Nr»   r5   r/   r-   rô   rô   Ù  s   € € € € € Øˆr/   c                   ó    ‡ — e Zd Zdˆ fd„	Zˆ xZS )r�   Nc                 óH   •— t          ¦   «                              ¦   «          d S r4   r  ©rH   Úargr>   s     €r-   rI   zScriptModule.__init__Ý  r   r/   r4   r±   r„   s   @r-   r�   r�   Ü  ó=   ø€ € € € € ð	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	r/   c                   ó    ‡ — e Zd Zdˆ fd„	Zˆ xZS )r5  Nc                 óH   •— t          ¦   «                              ¦   «          d S r4   r  r³  s     €r-   rI   zRecursiveScriptModule.__init__á  r   r/   r4   r±   r„   s   @r-   r5  r5  à  rµ  r/   c                 ó„  — t          | t          j        j        ¦  «        s| S t	          | ¦  «        }||v r|t	          | ¦  «                 S t          | d¦  «        r|                      ¦   «         n| } | ||<   i }| j                             ¦   «         D ]‹\  }}|dk    r3|                     ¦   «         D ]\  }}t          ||¦  «        ||<   Œ|||<   Œ>t          |t          j        j        ¦  «        r)t          |t          ¦  «        st          ||¦  «        ||<   Œ†|||<   ŒŒ|                     ¦   «         D ]\  }}|| j        |<   Œ| S )NÚ__prepare_scriptable__r—   )r€   rt   Únnr   ÚidrA   r¹  r?   rS   Ú!call_prepare_scriptable_func_implr�   )r·   rn  Úobj_idÚnew_obj_dictr;   Ú
sub_modulerN   rO   s           r-   r¼  r¼  å  sp  € Ý�c�5œ8œ?Ñ+Ô+ð Øˆ
å�‰WŒW€Fð �€~€~Ø•B�s‘G”GŒ}Ðå*1°#Ð7OÑ*PÔ*PÐ
Yˆ#×
$Ò
$Ñ
&Ô
&Ð
&ÐVY€Cð €Dˆ�Là€LàœL×.Ò.Ñ0Ô0ð 
,ð 
,ÑˆˆjØ�:ÒÐØ"×(Ò(Ñ*Ô*ð Kð K‘��1Ý AÀ!ÀTÑ JÔ J�
˜1‘�Ø!+ˆL˜ÑÐÝ˜
¥E¤H¤OÑ4Ô4ð 	,½ZØ�ñ>
ô >
ð 	,õ "CÀ:ÈtÑ!TÔ!TˆL˜ÑÐà!+ˆL˜ÑÐà×"Ò"Ñ$Ô$ð ð ‰ˆˆ1ØˆŒ�TÑÐà€Jr/   c                 ó&   — i }t          | |¦  «        S r4   )r¼  )r·   rn  s     r-   Úcall_prepare_scriptable_funcrÁ  	  s   € Ø')€DÝ,¨S°$Ñ7Ô7Ð7r/   c                 ó@   — t           j                             | ¦  «        S )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.
    )rt   ru   Ú
ScriptDict)r·   s    r-   Úcreate_script_dictrÄ    s   € õ Œ8×Ò˜sÑ#Ô#Ð#r/   c                 ó@   — t           j                             | ¦  «        S )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.
    )rt   ru   Ú
ScriptList)r·   Ú	type_hints     r-   Úcreate_script_listrÈ    s   € õ Œ8×Ò˜sÑ#Ô#Ð#r/   Úexample_inputsc                 ó�  — t           s| S |�t          j        d¦  «         t          | t          ¦  «        r| S t          | t
          ¦  «        r| S t          | t          ¦  «        r| S |rÎt          ¦   «         at          r¥t          t          ¦  «        }t          |¦  «        5  t          |t          ¦  «        r%|                     ¦   «         D ]\  }}|D ]} ||Ž  ŒŒn/t          |t          ¦  «        r|D ]}	 | |	Ž  Œnt          d¦  «        ‚ddd¦  «         n# 1 swxY w Y   nt          j        d¦  «         t          | t          j        j        ¦  «        rHt%          | ¦  «        } t          j        j                             | t          j        j        j        ¦  «        S t/          | d¦  «        r|                      ¦   «         n| } t          | t2          ¦  «        rt5          | ¦  «        S t          | t6          ¦  «        rt9          | ¦  «        S t;          j        | ¦  «        rÛt?          | ¦  «        }
tA          | t          j        j        ¦  «        rtC          d| › d�¦  «        ‚tA          | tD          j#        ¦  «        r| S tI          | ¦  «        stC          d¦  «        ‚tK          |  &                    ¦   «         ¦  «        d	k    rtC          d
¦  «        ‚|€tO          j(        |dz   ¦  «        }tS          | ||
¦  «         | S t;          j*        | ¦  «        st;          j+        | ¦  «        �rt?          | ¦  «        }
t/          | d¦  «        r| j,        } tO          j-        | ¦  «        }t/          | d¦  «        rtC          d| j.        z   ¦  «        ‚t_          | ¦  «         ta          | ¦  «        }|r|S tc          | | j2        ¦  «        }|€tO          j-        | ¦  «        }t          j3         4                    |
||tk          | ¦  «        ¦  «        }| j6        |_6        | |_7        tq          | |¦  «         |S t          j        j         9                    | ¦  «        S )aŒ  
    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 :ref:`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):
                    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):
                    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]))
    Nz]`optimize` is deprecated and has no effect. Use `with torch.jit.optimized_execution() insteadzˆ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¹  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'.r½   z\TorchScript classes does not support inheritance yet. Please directly inherit from 'object'.r%   Ú__script_if_tracing_wrapperÚ__script_unsupportedzTorchScript error: ):r   ÚwarningsÚwarnr€   rô   r�   ÚScriptFunctionr   r7   r   r   r   rS   r   Ú
ValueErrorrt   rº  r   rÁ  r˜   r™   rš   r   rA   r¹  ÚdictrÄ  ÚlistrÈ  r†  Úisclassr   Ú
issubclassr_   ÚenumÚEnumrC   r[   ÚmrorÁ   rÂ   r   rƒ  r„  Ú__original_fnÚ#createResolutionCallbackFromClosurerÌ  Ú"_check_directly_compile_overloadedr   r   rm   ru   Ú_jit_script_compiler   r  Ú_torchdynamo_inliner   Úcreate_script_class)r·   ÚoptimizeÚ
_frames_uprÄ   rÉ  Úmonkeytype_configrx   Úexample_inputÚexampleÚexamplesÚqualified_nameÚmaybe_already_compiled_fnrÅ   rÃ   s                 r-   Úscriptræ  ,  sÌ  € õZ ð Øˆ
àÐÝŒØkñ	
ô 	
ð 	
õ
 �#Õ+Ñ,Ô,ð Øˆ
Ý�#•|Ñ$Ô$ð Øˆ
Ý�#•~Ñ&Ô&ð Øˆ
àð õ
 *Ñ+Ô+ˆÝð 	Ý 2µ=Ñ AÔ AÐÝ!Ð"3Ñ4Ô4ð ð Ý˜n­dÑ3Ô3ð ð 2@×1EÒ1EÑ1GÔ1Gð -ð -Ñ-˜ Ø'4ð -ð -˜GØ"˜F GÐ,Ð,Ð,ð-ð-õ   µÑ5Ô5ð Ø$2ð 'ð '˜Ø˜˜X˜˜˜ð'õ %ðWñô ð ðð ð ñ ô ð ð ð ð ð ð øøøð ð ð ð øõ& ŒMðiñô ð õ �#•u”x”Ñ'Ô'ð ^Ý*¨3Ñ/Ô/ˆÝŒyÔ#×8Ò8Ø•”Ô%Ô>ñ
ô 
ð 	
õ /6°cÐ;SÑ.TÔ.TÐ]ˆc×(Ò(Ñ*Ô*Ð*ÐZ]ˆå�#•tÑÔð 'Ý! #Ñ&Ô&Ð&Ý�#•tÑÔð 'Ý! #Ñ&Ô&Ð&å„�sÑÔð 8=Ý(¨Ñ-Ô-ˆõ �c�5œ8œ?Ñ+Ô+ð 	ÝØm˜ÐmÐmÐmñô ð õ �c�4œ9Ñ%Ô%ð 	ØˆJå" 3Ñ'Ô'ð 	Ýð0ñô ð õ ˆs�wŠw‰yŒy‰>Œ>˜AÒÐÝð9ñô ð ð ˆ<Ý ÔBÀ:ÐPQÁ>ÑRÔRˆDÝ# C¨¨~Ñ>Ô>Ð>Øˆ
Ý	Ô	˜CÑ	 Ô	 ð =¥GÔ$4°SÑ$9Ô$9ñ =Ý(¨Ñ-Ô-ˆå�3Ð5Ñ6Ô6ð 	JØÔ#ˆCÝ ÔDÀSÑIÔIˆDõ �3Ð.Ñ/Ô/ð 	QÝÐ4°sÔ7OÑOÑPÔPÐPå*¨3Ñ/Ô/Ð/Ý$@ÀÑ$EÔ$EÐ!Ø$ð 	-Ø,Ð,Ý˜#˜sœ|Ñ,Ô,ˆØˆ<Ý ÔDÀSÑIÔIˆDÝŒX×)Ò)Ø˜C Õ'7¸Ñ'<Ô'<ñ
ô 
ˆð ”[ˆŒ
à!$ˆÔÝ  RÑ(Ô(Ð(Øˆ	åŒyÔ#×7Ò7¸Ñ<Ô<Ð<s   ÂA*DÄDÄDc                 óª   — |                      ¦   «         D ]=\  }}|| vs| |         |k    r(t          j        j                             |d|› �¦  «        ‚Œ>d S )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 )rS   rt   r˜   ÚfrontendÚFrontendError)Úimpl_defaultsÚoverload_defaultsÚlocr;   Úoverload_values        r-   Ú_check_overload_defaultsrî  v  s~   € Ø 1× 7Ò 7Ñ 9Ô 9ð ð ÑˆˆnØ�}Ð$Ð$¨°dÔ(;¸~Ò(MÐ(MÝ”)Ô$×2Ò2Øð$à!ð$ð $ñô ð ð )Nðð r/   c                 óâ  — t          | | j        ¦  «                             ¦   «         }t          j        j                             | d d t          j        | ¦  «        ¦  «        }t          ||j        ¦  «        }t          | ¦  «        }t          |¦  «        }t          j        |¦  «        }t          |||                     ¦   «         ¦  «         t          j                             ||||||¦  «        }	|	S r4   )r   rm   Údeclrt   r˜   ÚannotationsÚget_signaturer†  r„  r   rÁ   rÙ  rî  Úrangeru   Ú_jit_script_compile_overload)
Úoverload_fnÚ	qual_nameÚimpl_fnÚoverload_declÚoverload_signatureÚimpl_astrë  Úimplementation_defaultsrÄ   rÃ   s
             r-   Ú_compile_function_with_overloadrü  �  sç   € Ý ¨[Ô-AÑBÔB×GÒGÑIÔI€MÝœÔ.×<Ò<Ø�T˜4¥Ô!1°+Ñ!>Ô!>ñô Ðõ ˜7 GÔ$4Ñ5Ô5€HÝ(¨Ñ5Ô5ÐÝ.¨wÑ7Ô7ÐÝÔ<¸WÑEÔE€DÝØÐ!2°M×4GÒ4GÑ4IÔ4Iñô ð õ 
Œ×	.Ò	.ØØØØØØñ
ô 
€Bð €Ir/   c                 ój  — t          | ¦  «        }t          | ¦  «        }t          j        |¦  «        }|€|S | |v r"t	          t          j        d| ¦  «        ¦  «        ‚g }|D ]&}|                     t          ||| ¦  «        ¦  «         Œ'|r||z   }t          | |¦  «         t          j	        |¦  «         |S )NÚfunction)
r   r   rÁ   Ú_get_fn_overloadsr_   Ú,get_overload_no_implementation_error_messageÚappendrü  r   Ú_clear_fn_overloads)r·   Úexisting_compiled_fnsrö  Úuncompiled_overloadsÚcompiled_fnsrõ  s         r-   Ú_get_overloadsr  ˜  sè   € å9¸#Ñ>Ô>ÐÝ Ñ$Ô$€IÝ(Ô:¸9ÑEÔEÐØÐ#Ø$Ð$à
Ð"Ð"Ð"ÝÝÔFÀzÐSVÑWÔWñ
ô 
ð 	
ð €LØ+ð 
ð 
ˆØ×ÒÝ+¨K¸ÀCÑHÔHñ	
ô 	
ð 	
ð 	
ð ð <Ø,¨|Ñ;ˆõ ˜C Ñ.Ô.Ð.ÝÔ% iÑ0Ô0Ð0ØÐr/   c                 ó�   — t          | ¦  «        }t          j        |¦  «        st          | ¦  «        rt	          d|› d�¦  «        ‚d S )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Á   rÿ  r   r_   )r·   rö  s     r-   rÚ  rÚ  ´  si   € Ý Ñ$Ô$€IÝÔ& yÑ1Ô1ð 
Õ5RÐSVÑ5WÔ5Wð 
ÝðF˜	ð Fð Fð Fñ
ô 
ð 	
ð
ð 
r/   c                 ó>  — t          j        | ¦  «        st          d¦  «        ‚t          | ¦  «        st          d¦  «        ‚t	          | t
          j        j        ¦  «        o$t          |  	                    ¦   «         ¦  «        dk    }|s4t          |  	                    ¦   «         ¦  «        dk    rt          d¦  «        ‚t          | ¦  «        }t          j        d¦  «        }t          | | j        ¦  «        }t
          j                             ||||¦  «        }|| _        | S )Nz$interface must be applied to a classz1TorchScript interfaces must inherit from 'object'é   r½   zmTorchScript interface does not support inheritance yet. Please directly inherit from 'object' or 'nn.Module'.r%   )r†  rÓ  r_   rC   rÔ  rt   rº  r   r[   r×  r   rÁ   rÂ   r   rm   ru   Ú_jit_script_interface_compileÚ__torch_script_interface__)r·   Úis_module_interfacerä  r(  rÅ   Úmangled_classnames         r-   Ú	interfacer  ¾  s  € ÝŒ?˜3ÑÔð CÝÐAÑBÔBÐBÝ˜sÑ#Ô#ð PÝÐNÑOÔOÐOõ % S­%¬(¬/Ñ:Ô:ÐR½sÀ3Ç7Â7Á9Ä9¹~¼~ÐQRÒ?RÐàð 
¥3 s§w¢w¡y¤y¡>¤>°AÒ#5Ð#5ÝðDñ
ô 
ð 	
õ
 % SÑ)Ô)€NÝ
Ô
9¸!Ñ
<Ô
<€Cõ ˜C ¤Ñ
.Ô
.€CÝœ×>Ò>Ø˜˜SÐ"5ñô Ðð &7€CÔ"Ø€Jr/   c                 óª   — t          | ¦  «        }t          j                             ||¦  «        }t	          j        | ¦  «        }t          | ||¦  «        S r4   )r   rt   ru   Ú	CallStackrÁ   Ú'createResolutionCallbackForClassMethodsr   )r·   rì  Ú
_qual_nameÚerror_stackr(  s        r-   Ú_recursive_compile_classr  Ý  sJ   € Ý  Ñ%Ô%€Jõ ”(×$Ò$ Z°Ñ5Ô5€KÝ
Ô
?ÀÑ
DÔ
D€CÝ& s¨C°Ñ<Ô<Ð<r/   ú ÚsÚpaddingÚoffsetÚcharc                 ó¶   ‡— |t          | ¦  «        k    r|t          | ¦  «        z  }d                     ˆfd„t          ||z   ¦  «        D ¦   «         ¦  «        | z   S )Nra  c                 ó   •— g | ]}‰‘ŒS r5   r5   )rM   r¤   r  s     €r-   rP   zpad.<locals>.<listcomp>í  s   ø€ Ð:Ð:Ð:˜Q�DÐ:Ð:Ð:r/   )r[   Újoinró  )r  r  r  r  s      `r-   Úpadr  ê  s]   ø€ Ø•#�a‘&”&ÒÐØ•3�q‘6”6ÑˆØ�7Š7Ð:Ð:Ð:Ð:¥%¨°&Ñ(8Ñ"9Ô"9Ð:Ñ:Ô:Ñ;Ô;¸aÑ?Ð?r/   c                   ó:   — e Zd Zddededefd„Zdedefd	„Zd
„ ZdS )Ú_ScriptProfileColumné   r   ÚheaderÚ	alignmentr  c                 ó>   — || _         || _        || _        i | _        d S r4   )r!  r"  r  Úrows)rH   r!  r"  r  s       r-   rI   z_ScriptProfileColumn.__init__ñ  s"   € ØˆŒØ"ˆŒØˆŒØ$&ˆŒ	ˆ	ˆ	r/   Úlinenor1   c                 ó   — || j         |<   d S r4   )r$  )rH   r%  r1   s      r-   Úadd_rowz_ScriptProfileColumn.add_row÷  s   € Ø!ˆŒ	�&ÑÐÐr/   c                 ó˜  ‡ ‡— t          ‰ j        ¦  «        }g }‰ j                             ¦   «         D ]H\  }}t	          |¦  «        }|                     ||f¦  «         t          t          |¦  «        |¦  «        }ŒI‰ j        dk    r|‰ j        z   Š‰‰‰ j        z  z  ŠndŠˆˆ fd„|D ¦   «         }t          ‰ j        ‰‰ j	        ¦  «        |fS )Nr   c                 óF   •— g | ]\  }}|t          |‰‰j        ¦  «        f‘ŒS r5   )r  r  )rM   ry  Úcellr  rH   s      €€r-   rP   z4_ScriptProfileColumn.materialize.<locals>.<listcomp>  s0   ø€ ÐMÐMÐM¹9¸3À�•c˜$ ¨¬Ñ5Ô5Ð6ÐMÐMÐMr/   )
r[   r!  r$  rS   rP  r  Úmaxr"  r  r  )rH   Ú
max_lengthr$  ry  r1   r*  r  s   `     @r-   Úmaterializez _ScriptProfileColumn.materializeú  s×   øø€ Ý˜œÑ%Ô%ˆ
Ø&(ˆØœ)Ÿ/š/Ñ+Ô+ð 	4ð 	4‰JˆC�Ý�u‘:”:ˆDØ�KŠK˜˜d˜Ñ$Ô$Ð$Ý�S ™YœY¨
Ñ3Ô3ˆJˆJàŒ>˜AÒÐØ  4¤>Ñ1ˆGØ�w ¤Ñ/Ñ/ˆGˆGàˆGàMÐMÐMÐMÐMÈÐMÑMÔMˆÝ�4”; ¨¬Ñ5Ô5°tÐ;Ð;r/   N)r   r   )	rm   rn   ro   rP  r0  rI   r   r'  r-  r5   r/   r-   r  r  ð  ss   € € € € € ð'ð '˜sð '¨sð 'Àð 'ð 'ð 'ð 'ð"˜cð "¨#ð "ð "ð "ð "ð<ð <ð <ð <ð <r/   r  c                   ó<   — e Zd Zdee         dee         fd„Zd„ ZdS )Ú_ScriptProfileTableÚcolsÚsource_rangec                 ó"   — || _         || _        d S r4   )r0  r1  )rH   r0  r1  s      r-   rI   z_ScriptProfileTable.__init__  s   € ØˆŒ	Ø(ˆÔÐÐr/   c           	      ó&  — g }g }d}| j         D ]B}|                     ¦   «         \  }}||z  }|                     |t          |¦  «        f¦  «         ŒC|                     |¦  «         |                     t	          dt          |¦  «        dd¦  «        ¦  «         | j        D ]^}d}|D ]B\  }}|                     |¦  «        }	|	€!|t	          dt          |¦  «        ¦  «        z  }Œ=||	z  }ŒC|                     |¦  «         Œ_d                     |¦  «        S )Nra  r   ú=ú
)	r0  r-  r  rÑ  r  r[   r1  Úgetr  )
rH   ÚoutputsÚcellsÚheader_bufferÚcolr!  r$  ÚlineÚ
row_bufferr*  s
             r-   Údump_stringz_ScriptProfileTable.dump_string  s&  € ØˆØ24ˆØˆØ”9ð 	/ð 	/ˆCØŸ?š?Ñ,Ô,‰LˆF�DØ˜VÑ#ˆMØ�LŠL˜&¥$ t¡*¤*Ð-Ñ.Ô.Ð.Ð.à�Š�}Ñ%Ô%Ð%Ø�Š•s˜2�s =Ñ1Ô1°1°cÑ:Ô:Ñ;Ô;Ð;ØÔ%ð 	'ð 	'ˆDØˆJØ %ð 'ð '‘�˜Ø—x’x ‘~”~�Ø�<Ø¥# b­#¨f©+¬+Ñ"6Ô"6Ñ6�J�Jà $Ñ&�J�JØ�NŠN˜:Ñ&Ô&Ð&Ð&Ø�yŠy˜Ñ!Ô!Ð!r/   N)rm   rn   ro   r   r  r0  rI   r=  r5   r/   r-   r/  r/    sO   € € € € € ð)˜TÐ"6Ô7ð )ÀtÈCÄyð )ð )ð )ð )ð"ð "ð "ð "ð "r/   r/  c                   ó2   — e Zd Zd„ Zd„ Zd„ Zdefd„Zd„ ZdS )Ú_ScriptProfilec                 óL   — t           j                             ¦   «         | _        d S r4   )r
   Ú	profilingr?  ÚprofilerT   s    r-   rI   z_ScriptProfile.__init__)  s   € ÝÔ(×7Ò7Ñ9Ô9ˆŒˆˆr/   c                 ó8   — | j                              ¦   «          d S r4   )rB  ÚenablerT   s    r-   rD  z_ScriptProfile.enable,  s   € ØŒ×ÒÑÔÐÐÐr/   c                 ó8   — | j                              ¦   «          d S r4   )rB  ÚdisablerT   s    r-   rF  z_ScriptProfile.disable/  s   € ØŒ×ÒÑÔÐÐÐr/   rÐ   c                 ó  ‡— g }| j                              ¦   «         D �]Õ}|                     ¦   «         }|                     ¦   «                              ¦   «         }t          d„ |D ¦   «         ¦  «        Šˆfd„|D ¦   «         }|                     ¦   «         }|t          |¦  «        z   }t          ||¦  «        }t          d¦  «        }t          d¦  «        }	t          d¦  «        }
t          ddd¦  «        }| 
                    ¦   «         }|D ]ž}|                     ||¦  «         |                     ||||z
           ¦  «         |                     |¦  «        }|�P|	                     ||                     ¦   «         ¦  «         |
                     ||                     ¦   «         ¦  «         ŒŸt          ||	|
|gt!          |¦  «        ¦  «        }|                     |                     ¦   «         ¦  «         �Œ×d	                     |¦  «        S )
Nc                 ór   — g | ]4}t          |¦  «        t          |                     d ¦  «        ¦  «        z
  ‘Œ5S )r  )r[   Úlstrip)rM   r;  s     r-   rP   z._ScriptProfile.dump_string.<locals>.<listcomp>7  s7   € ÐUÐUÐUÀ�#˜d™)œ)¥c¨$¯+ª+°cÑ*:Ô*:Ñ&;Ô&;Ñ;ÐUÐUÐUr/   c                 ó$   •— g | ]}|‰d …         ‘ŒS r4   r5   )rM   r;  Údedents     €r-   rP   z._ScriptProfile.dump_string.<locals>.<listcomp>8  s!   ø€ ÐCÐCÐC¨d˜D   œMÐCÐCÐCr/   zLine #ÚHitsz	Time (ns)zLine Contentsr   r%   z

)rB  Ú_dump_statsÚsourceÚtextÚ
splitlinesÚminÚstarting_linenor[   ró  r  Úline_mapr'  r6  ÚcountÚduration_nsr/  rÒ  r  r=  r  )rH   r7  Úsource_statsÚ
source_refÚsource_linesÚ
start_lineÚend_liner1  r%  ÚhitsÚtime_nsÚline_contentsÚstatsr;  ÚstatÚtablerK  s                   @r-   r=  z_ScriptProfile.dump_string2  sð  ø€ ØˆØ œL×4Ò4Ñ6Ô6ð 	0ñ 	0ˆLØ%×,Ò,Ñ.Ô.ˆJØ%Ÿ?š?Ñ,Ô,×7Ò7Ñ9Ô9ˆLÝÐUÐUÈÐUÑUÔUÑVÔVˆFØCÐCÐCÐC°lÐCÑCÔCˆLà#×3Ò3Ñ5Ô5ˆJØ!¥C¨Ñ$5Ô$5Ñ5ˆHÝ  ¨XÑ6Ô6ˆLÝ)¨(Ñ3Ô3ˆFÝ'¨Ñ/Ô/ˆDÝ*¨;Ñ7Ô7ˆGÝ0°À!ÀQÑGÔGˆMØ ×)Ò)Ñ+Ô+ˆEØ$ð >ð >�Ø—’˜t TÑ*Ô*Ð*Ø×%Ò% d¨L¸À
Ñ9JÔ,KÑLÔLÐLØ—y’y ‘”�ØÐ#Ø—L’L  t§z¢z¡|¤|Ñ4Ô4Ð4Ø—O’O D¨$×*:Ò*:Ñ*<Ô*<Ñ=Ô=Ð=øå'Ø˜˜w¨Ð6½¸\Ñ8JÔ8Jñô ˆEð �NŠN˜5×,Ò,Ñ.Ô.Ñ/Ô/Ð/Ñ/Ø�{Š{˜7Ñ#Ô#Ð#r/   c                 óH   — t          |                      ¦   «         ¦  «         d S r4   )Úprintr=  rT   s    r-   Údumpz_ScriptProfile.dumpP  s"   € Ýˆd×ÒÑ Ô Ñ!Ô!Ð!Ð!Ð!r/   N)	rm   rn   ro   rI   rD  rF  rP  r=  rc  r5   r/   r-   r?  r?  (  sk   € € € € € ð:ð :ð :ðð ð ðð ð ð$˜Sð $ð $ð $ð $ð<"ð "ð "ð "ð "r/   r?  c                 ó   — | €
J d¦   «         ‚| S )NzUnwrapping null optionalr5   )r…  s    r-   Ú_unwrap_optionalre  T  s   € Øˆ=ˆ=Ð4‰=Œ=ˆ=Ø€Hr/   zaten::_unwrap_optionalzaten::is_scriptingzaten::has_torch_functionr4   )Nr   NN)r   r  )|r  Úcollectionsrj  rÕ  r«   r†  r)   rÍ  Útypingr   r   r   r   r   r   r	   rt   Útorch._jit_internalrÁ   Útorch._classesr
   r   Ú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&   r7   ru   rC  r_  rÏ  r.   Ú
__reduce__Ú
namedtupler0   r8   r<   rC   rE   rq   r2   r†   r³   ÚWarningrº   rÆ   rÈ   rP  rº  rÚ   Ú_magic_methodsrô   r  r  rd   r�   r5  r?   rS   r;   ÚitemÚcallabler€   rø   Ú
startswithrA   r‰  Ú_compiled_methods_allowlistr®  ÚmethodÚendswithrm   r¼  rÁ  rÄ  rÈ  ræ  rî  rü  r  rÚ  r  r  rÔ   r0  r  r  r/  r?  re  Úis_scriptingr5   r/   r-   ú<module>r€     s}	  ððð ð Ð Ð Ð Ø €€€Ø €€€Ø Ð Ð Ð Ø €€€Ø €€€Ø €€€Ø ?Ð ?Ð ?Ð ?Ð ?Ð ?Ð ?Ð ?Ð ?Ð ?Ð ?Ð ?Ð ?Ð ?Ð ?Ð ?Ð ?Ð ?à €€€Ø +Ð +Ð +Ð +Ð +Ð +Ø "Ð "Ð "Ð "Ð "Ð "Ø /Ð /Ð /Ð /Ð /Ð /Ø 1Ð 1Ð 1Ð 1Ð 1Ð 1Ø AÐ AÐ AÐ AÐ AÐ AÐ AÐ Aðð ð ð ð ð ð ð ð ð ð
ð ð ð ð ð ð ð ð ð ð ð ðð ð ð ð ð ð ð ð ð ð ð ð ð ð PÐ OÐ OÐ OÐ OÐ OÐ OÐ OÐ OÐ OØ Ð Ð Ð Ð Ð ðð ð ð ð ð ð ð ð ð ð
 ;Ð :Ð :Ð :Ð :Ð :Ð :Ð :Ø "Ð "Ð "Ð "Ð "Ð "Ø 1Ð 1Ð 1Ð 1Ð 1Ð 1à!Ð!Ñ#Ô#€à":€„Ô Ô Ø$.€„Ô Ô !Ø”Ô(€ð€Ô ð €
ˆ>˜;Ñ 'Ô 'Ð 'ð
Að Að Að $€Ô ð ð Ø&�Ô& {°W¸fÐ4EÑFÔF€I€Iðð ð ðI€	Ô ðXð ð ð$ð $ð $ðCð Cð Cð( "ð  "ð  "ð  "ð  "ñ  "ô  "ð  "ðF&'ð &'ð &'ð &'ð &'Ð*ñ &'ô &'ð &'ðb:-ð :-ð :-ð :-ð :-�ñ :-ô :-ð :-ðz+ð +ð +ð +ð +ñ +ô +ð +ð
	ð 	ð 	ð 	ð 	�Gñ 	ô 	ð 	ð+ð +ð +ð((ð (ð (ð (ð (ñ (ô (ð (ð'Øð'Ø14ð'à
„X„_ð'ð 'ð 'ð 'ð. ñ V	ðð ð €Nð><Cð <Cð <Cð <Cð <Cñ <Cô <Cð <Cð| &ð Dð Dˆð	Kð 	Kð 	Kð 	ˆÐ$ k°?ÑCÔCÐCÐCðPBð PBð PBð PBð PB�v¨ð PBñ PBô PBð PBðd{ð {ð {ð {ð { ñ {ô {ð {ðD
 ,Ô4×:Ò:Ñ<Ô<ð *ð *‰
ˆˆdØˆx˜‰~Œ~ð 	 j j°°xÑ&@Ô&@ð 	ØØ�?Š?˜4Ñ Ô ð 	 G G¨L¸$Ñ$?Ô$?ð 	Øð 	ˆ�˜d DÑ)Ô)Ð)Ð)ð
ð 
ð 
ð&#ð &#ð &#ÐðPð ð ð %˜ U¤X¤_Ñ5Ô5ð Nð N‰ˆˆfØ�?Š?˜4Ñ Ô ð 	 D§M¢M°,Ñ$?Ô$?ð 	ØàÐ-Ô6Ð6Ð6ØÐ7Ð7Ð7àˆGÐ)¨6¬?¸J¸JÀtÑ<LÔ<LÑMÔMÐMøðNðð ð ð ð ñ ô ð ðð ð ð ð �u”x”ñ ô ð ðð ð ð ð  ñ ô ð ð
!ð !ð !ðH8ð 8ð 8ð
$ð $ð $ð $ð $ð $ð $ð  ØØ	ØLPðC=ð C=ð
 ˜$˜uœ+ t¨H°d¸5´kÐ,AÔ'BÀDÐHÔIðC=ð C=ð C=ð C=ðT
ð ð ðð ð ð.ð ð ð8
ð 
ð 
ðð ð ð>=ð =ð =ð ”(Ô*€Ø 
€
ˆ?˜KÑ (Ô (Ð (ð@ð @ˆ3ð @˜ð @ cð @°Sð @ð @ð @ð @ð<ð <ð <ð <ð <ñ <ô <ð <ð8"ð "ð "ð "ð "ñ "ô "ð "ð8)"ð )"ð )"ð )"ð )"ñ )"ô )"ð )"ðXð ð ð
 Ð Ð"Ð$<Ñ =Ô =Ð =Ø Ð �-Ô,Ð.BÑ CÔ CÐ CØ Ð Ð$Ð&@Ñ AÔ AÐ AØ Ð Ð*Ð,FÑ GÔ GÐ GØ Ð Ð-Ð/IÑ JÔ JÐ JÐ JÐ Jr/   