§
    ž²ÅjÐ  ã                  óP  — U d dl m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mZ d dlmZ d dlZd dlmZmZ d dlmZmZmZ erd dlmZ dd	gZ	 d dl Z!d
Z"n# e#$ r dZ"dZ!Y nw xY w ej$        ¦   «         Z%i Z&de'd<    edd¬¦  «        Z( G d„ d¦  «        Z)d„ Z* G d„ d	ej+        j,        e)¦  «        Z-d„ Z. ej/        d¬¦  «        d„ ¦   «         Z0 ej/        d¬¦  «        d„ ¦   «         Z1 ej/        d¬¦  «        d„ ¦   «         Z2d„ Z3d„ Z4da5d„ Z6d„ Z7d,d„Z8d „ Z9d-d#„Z: G d$„ d¦  «        Z;ej<        e;j=        _<        e)j>        j<        e;j>        _<        e)j?        j<        e;j?        _<        ej<        e;j@        _<         G d%„ d&e=¦  «        ZA G d'„ d(e;eA¬)¦  «        ZBd.d+„ZCdS )/é    )ÚannotationsN)ÚAnyÚcastÚDictÚOptionalÚTypeÚTYPE_CHECKINGÚTypeVarÚUnion)ÚSelf)Ú_toÚ_type)Ú_boolÚ_intÚStorage)ÚDeviceLikeTypeÚTypedStorageÚUntypedStorageTFz_Dict[int, threading.RLock]Ú_share_memory_mapÚTú!Union[_StorageBase, TypedStorage])Úboundc                  óB  ‡ — e Zd ZU ded<   dZded<   dZded<   ded<   d	Zd
ed<   d„ Zdid„Zd„ Z	d„ Z
djdkd„Zdld„Zdid„Zdid„Z	 dmdnd„Z	 dmdld„Zdmdld„Zdid „Zdid!„Zdid"„Zdod#„Zd$„ Zd%„ Zedpd)„¦   «         Zedpd*„¦   «         Zedqd+„¦   «         Zed	d	d,œdqd-„¦   «         Zedqd.„¦   «         Zedqd/„¦   «         Zdld0„Zd1„ Z drd2„Z!dld3„Z"d4„ Z#d5„ Z$d6„ Z%dod7„Z&edqd8„¦   «         Z'd9„ Z(ed:„ ¦   «         Z)e*d;„ ¦   «         Z+e*d<„ ¦   «         Z,edld=„¦   «         Z-edld>„¦   «         Z.d?„ Z/dsd@„Z0dA„ Z1dB„ Z2dC„ Z3dD„ Z4dE„ Z5ˆ fdF„Z6dG„ Z7dH„ Z8dI„ Z9dJ„ Z:dK„ Z;ddLœdtdN„Z<dO„ Z=dP„ Z>dQ„ Z?dR„ Z@dS„ ZAdT„ ZBdU„ ZCdV„ ZDdW„ ZEdX„ ZFdY„ ZGdZ„ ZHd[„ ZId\„ ZJd]„ ZKd^„ ZLdudvda„ZMdudvdb„ZNdc„ ZOedddeœdf„¦   «         ZPdg„ ZQdh„ ZRˆ xZSS )wÚ_StorageBaser   Ú_cdataFr   Ú	is_sparseÚis_sparse_csrztorch.deviceÚdeviceNú_Optional[torch.device]Ú_fake_devicec                ó   — d S ©N© ©ÚselfÚargsÚkwargss      ú>C:\Projects\Historical\venv\Lib\site-packages\torch/storage.pyÚ__init__z_StorageBase.__init__:   s   € Øˆó    Úreturnr   c                ó   — t           ‚r"   ©ÚNotImplementedError©r%   s    r(   Ú__len__z_StorageBase.__len__=   ó   € Ý!Ð!r*   c                ó   — t           ‚r"   r-   ©r%   Úidxs     r(   Ú__getitem__z_StorageBase.__getitem__@   r1   r*   c                ó   — t           ‚r"   r-   r$   s      r(   Ú__setitem__z_StorageBase.__setitem__C   r1   r*   Úsourcer   Únon_blockingú_Optional[_bool]c                ó   — t           ‚r"   r-   ©r%   r8   r9   s      r(   Úcopy_z_StorageBase.copy_F   r1   r*   r   c                ó   — t           ‚r"   r-   r/   s    r(   Únewz_StorageBase.newI   r1   r*   c                ó   — t           ‚r"   r-   r/   s    r(   Únbytesz_StorageBase.nbytesL   r1   r*   c                ó*   — |                       ¦   «         S r"   )rA   r/   s    r(   Úsizez_StorageBase.sizeO   s   € Ø�{Š{‰}Œ}Ðr*   Údtypeú_Optional[str]c                ó$   — t          | ||¦  «        S r"   )r   )r%   rD   r9   s      r(   Útypez_StorageBase.typeR   s   € õ �T˜5 ,Ñ/Ô/Ð/r*   c                ó†   — |rt          j        d|¦  «        nt          j        d¦  «        }|                      ||¬¦  «        S )aû  Returns a copy of this object in CUDA memory.

        If this object is already in CUDA memory and on the correct device, then
        no copy is performed and the original object is returned.

        Args:
            device (int): The destination GPU id. Defaults to the current device.
            non_blocking (bool): If ``True`` and the source is in pinned memory,
                the copy will be asynchronous with respect to the host. Otherwise,
                the argument has no effect.
        Úcuda©r   r9   ©Útorchr   Úto©r%   r   r9   Údevice2s       r(   rI   z_StorageBase.cudaW   s?   € ð 39ÐR•%”,˜v vÑ.Ô.Ð.½e¼lÈ6Ñ>RÔ>RˆØ�wŠw˜g°LˆwÑAÔAÐAr*   c                ó†   — |rt          j        d|¦  «        nt          j        d¦  «        }|                      ||¬¦  «        S )aù  Returns a copy of this object in HPU memory.

        If this object is already in HPU memory and on the correct device, then
        no copy is performed and the original object is returned.

        Args:
            device (int): The destination HPU id. Defaults to the current device.
            non_blocking (bool): If ``True`` and the source is in pinned memory,
                the copy will be asynchronous with respect to the host. Otherwise,
                the argument has no effect.
        ÚhpurJ   rK   rN   s       r(   rQ   z_StorageBase.hpuh   s?   € ð 28ÐP•%”,˜u fÑ-Ô-Ð-½U¼\È%Ñ=PÔ=PˆØ�wŠw˜g°LˆwÑAÔAÐAr*   c                ó   — t           ‚r"   r-   r/   s    r(   Úelement_sizez_StorageBase.element_sizew   r1   r*   c                ó   — | j         j        S r"   )r   Úindexr/   s    r(   Ú
get_devicez_StorageBase.get_devicez   s   € ØŒ{Ô Ð r*   c                ó   — t           ‚r"   r-   r/   s    r(   Údata_ptrz_StorageBase.data_ptr}   r1   r*   c                ó   — t           ‚r"   r-   r/   s    r(   Ú	resizablez_StorageBase.resizable€   r1   r*   c                ó   — t           ‚r"   r-   r$   s      r(   Ú_share_filename_cpu_z!_StorageBase._share_filename_cpu_„   r1   r*   c                ó   — t           ‚r"   r-   r$   s      r(   Ú_share_fd_cpu_z_StorageBase._share_fd_cpu_‡   r1   r*   ÚclsúType[T]rC   c                ó   — t           ‚r"   r-   ©r_   rC   s     r(   Ú_new_using_filename_cpuz$_StorageBase._new_using_filename_cpuŠ   ó   € å!Ð!r*   c                ó   — t           ‚r"   r-   rb   s     r(   Ú_new_using_fd_cpuz_StorageBase._new_using_fd_cpuŽ   rd   r*   c                ó   — t           ‚r"   r-   ©r_   r&   r'   s      r(   Úfrom_bufferz_StorageBase.from_buffer’   rd   r*   )r   rD   c               ó   — t           ‚r"   r-   )r_   ÚmanagerÚobjrC   r   rD   s         r(   Ú_new_shared_filename_cpuz%_StorageBase._new_shared_filename_cpu–   s
   € õ "Ð!r*   c                ó   — t           ‚r"   r-   rh   s      r(   Ú_release_ipc_counter_cudaz&_StorageBase._release_ipc_counter_cuda¢   rd   r*   c                ó   — t           ‚r"   r-   rh   s      r(   Ú_new_with_weak_ptrz_StorageBase._new_with_weak_ptr¦   rd   r*   c                ó   — t           ‚r"   r-   r/   s    r(   Ú_shared_decrefz_StorageBase._shared_decrefª   r1   r*   c                ó   — t           ‚r"   r-   r$   s      r(   Ú_write_filez_StorageBase._write_file­   r1   r*   c                ó   — t           ‚r"   r-   ©r%   rC   s     r(   Úresize_z_StorageBase.resize_°   r1   r*   c                ó   — t           ‚r"   r-   r$   s      r(   Ú	_weak_refz_StorageBase._weak_ref³   r1   r*   c                ó   — t           ‚r"   r-   r$   s      r(   Ú_set_from_filez_StorageBase._set_from_file¶   r1   r*   c                ó   — t           ‚r"   r-   r$   s      r(   Ú
_set_cdataz_StorageBase._set_cdata¹   r1   r*   c                ó   — t           ‚r"   r-   r$   s      r(   Ú_share_cuda_z_StorageBase._share_cuda_¼   r1   r*   c                ó   — t           ‚r"   r-   r/   s    r(   Ú	is_sharedz_StorageBase.is_shared¿   r1   r*   c                ó   — t           ‚r"   r-   rh   s      r(   Ú_new_shared_cudaz_StorageBase._new_shared_cudaÂ   rd   r*   c                ó   — t           ‚r"   r-   r$   s      r(   Ú_shared_increfz_StorageBase._shared_increfÆ   r1   r*   c                ó   — t           ‚r"   r-   rh   s      r(   Ú_free_weak_refz_StorageBase._free_weak_refÉ   rd   r*   c                ó   — t           ‚r"   r-   r/   s    r(   Úis_cudaz_StorageBase.is_cudaÍ   rd   r*   c                ó   — t           ‚r"   r-   r/   s    r(   Úis_hpuz_StorageBase.is_hpuÑ   rd   r*   c                ó   — t           ‚r"   r-   )r_   ÚfilenameÚsharedrA   s       r(   Ú	from_filez_StorageBase.from_fileÕ   rd   r*   c                ó   — t           ‚r"   r-   rh   s      r(   Ú_expiredz_StorageBase._expiredÙ   rd   r*   c                ó   — t           ‚r"   r-   r$   s      r(   Ú	_byteswapz_StorageBase._byteswapÝ   r1   r*   c                ó   — t           ‚r"   r-   r$   s      r(   Ú_get_filenamez_StorageBase._get_filenameà   r1   r*   c                ó$  ‡ — dt          j        ‰ ¦  «        › d‰ j        › dt          ‰ ¦  «        › d�}‰ j        j        dk    rd|z   S dd                     ˆ fd	„t          ‰                      ¦   «         ¦  «        D ¦   «         ¦  «        z   }|d
z   |z   S )Nú[z(device=ú
) of size ú]Úmetaú...
ú ú
 c              3  óB   •K  — | ]}t          ‰|         ¦  «        V — Œd S r"   ©Ústr©Ú.0Úir%   s     €r(   ú	<genexpr>z(_StorageBase.__repr__.<locals>.<genexpr>ç   s-   øè è € Ð#MÐ#M°Q¥C¨¨Q¬¡L¤LÐ#MÐ#MÐ#MÐ#MÐ#MÐ#Mr*   ú
)rL   Útypenamer   ÚlenrG   ÚjoinÚrangerC   ©r%   Úinfo_strÚdata_strs   `  r(   Ú__repr__z_StorageBase.__repr__ã   s›   ø€ ØX•u”~ dÑ+Ô+ÐXÐX°T´[ÐXÐXÍCÐPTÉIÌIÐXÐXÐXˆØŒ;Ô˜vÒ%Ð%Ø˜XÑ%Ð%Ø˜ŸšÐ#MÐ#MÐ#MÐ#M½%ÀÇ	Â	ÁÄÑ:LÔ:LÐ#MÑ#MÔ#MÑMÔMÑMˆØ˜$‰ Ñ)Ð)r*   c                óx   ‡ — t          ˆ fd„t          ‰                      ¦   «         ¦  «        D ¦   «         ¦  «        S )Nc              3  ó(   •K  — | ]}‰|         V — Œd S r"   r#   r¢   s     €r(   r¥   z(_StorageBase.__iter__.<locals>.<genexpr>ë   ó'   øè è € Ð8Ð8 �D˜”GÐ8Ð8Ð8Ð8Ð8Ð8r*   )Úiterrª   rC   r/   s   `r(   Ú__iter__z_StorageBase.__iter__ê   s6   ø€ ÝÐ8Ð8Ð8Ð8¥U¨4¯9ª9©;¬;Ñ%7Ô%7Ð8Ñ8Ô8Ñ8Ô8Ð8r*   c                ó*   — |                       ¦   «         S r"   )Úcloner/   s    r(   Ú__copy__z_StorageBase.__copy__í   s   € Ø�zŠz‰|Œ|Ðr*   c                óš   — |                      di ¦  «        }| j        |v r|| j                 S |                      ¦   «         }||| j        <   |S )NrL   )Ú
setdefaultr   rµ   )r%   ÚmemoÚnew_storages      r(   Ú__deepcopy__z_StorageBase.__deepcopy__ð   sN   € Ø�Š˜w¨Ñ+Ô+ˆØŒ;˜$ÐÐØ˜œÔ$Ð$Ø—j’j‘l”lˆØ'ˆˆTŒ[ÑØÐr*   c                óŽ   — t          j        ¦   «         }t          j        | |d¬¦  «         t          |                     ¦   «         ffS ©NF)Ú_use_new_zipfile_serialization©ÚioÚBytesIOrL   ÚsaveÚ_load_from_bytesÚgetvalue©r%   Úbs     r(   Ú
__reduce__z_StorageBase.__reduce__ø   ó9   € ÝŒJ‰LŒLˆÝŒ
�4˜¸5ÐAÑAÔAÐAÝ  1§:¢:¡<¤< /Ð2Ð2r*   c                ón   •— t          ¦   «                              ¦   «         |                      ¦   «         z   S r"   )ÚsuperÚ
__sizeof__rC   ©r%   Ú	__class__s    €r(   rË   z_StorageBase.__sizeof__ý   s&   ø€ Ý‰wŒw×!Ò!Ñ#Ô# d§i¢i¡k¤kÑ1Ð1r*   c                óŠ   —  t          | ¦  «        |                      ¦   «         | j        ¬¦  «                             | ¦  «        S )úReturn a copy of this storage.©r   )rG   rA   r   r=   r/   s    r(   rµ   z_StorageBase.clone   s5   € à�t�D‰zŒz˜$Ÿ+š+™-œ-°´Ð<Ñ<Ô<×BÒBÀ4ÑHÔHÐHr*   c                ó    — t          | ¦  «        S ©z6Return a list containing the elements of this storage.)Úlistr/   s    r(   Útolistz_StorageBase.tolist  s   € å�D‰zŒzÐr*   c                óš   — | j         j        dk    r:t          j        |                      ¦   «         ¦  «                             | d¦  «        S | S )úAReturn a CPU copy of this storage if it's not already on the CPU.ÚcpuF©r   rG   rL   r   rC   r=   r/   s    r(   r×   z_StorageBase.cpu  s@   € àŒ;Ô˜uÒ$Ð$ÝÔ'¨¯	ª	©¬Ñ4Ô4×:Ò:¸4ÀÑGÔGÐGØˆr*   c                óž   — | j         j        dk    r<t          j        |                      ¦   «         d¬¦  «                             | d¦  «        S | S )zAReturn a MPS copy of this storage if it's not already on the MPS.ÚmpsrÐ   FrØ   r/   s    r(   rÚ   z_StorageBase.mps  sE   € àŒ;Ô˜uÒ$Ð$ÝÔ'¨¯	ª	©¬¸EÐBÑBÔB×HÒHÈÈuÑUÔUÐUØˆr*   c                óÖ  — t          |t          j        ¦  «        st          dt	          |¦  «        › �¦  «        ‚t          j        g t          j        | j        ¬¦  «                             t          t          | ¦  «        ¦  «                             |¦  «                             ¦   «         }|                     ¦   «         |                      ¦   «         k    r|                     ¦   «         }|S ©Nz*Argument 'dtype' must be torch.dtype, not ©rD   r   )Ú
isinstancerL   rD   Ú	TypeErrorrG   ÚtensorÚuint8r   Úset_r   r   rM   Ú_typed_storagerX   rµ   ©r%   rD   Ústorages      r(   r   z_StorageBase._to  s±   € Ý˜%¥¤Ñ-Ô-ð 	XÝÐVÍÈeÉÌÐVÐVÑWÔWÐWåŒL˜¥5¤;°t´{ÐCÑCÔCßŠT•$•w Ñ%Ô%Ñ&Ô&ßŠR�‰YŒYßŠ^ÑÔð	 	ð ×ÒÑÔ §¢¡¤Ò0Ð0Ø—m’m‘o”oˆGØˆr*   ©r9   r   c               ó€   — t          |t          j        ¦  «        st          j        |¦  «        }t          | ||¦  «        S r"   )rÞ   rL   r   r   )r%   r   r9   s      r(   rM   z_StorageBase.to!  s7   € Ý˜&¥%¤,Ñ/Ô/ð 	*Ý”\ &Ñ)Ô)ˆFÝ�4˜ Ñ.Ô.Ð.r*   c                ó@   — |                       t          j        ¦  «        S ©z"Casts this storage to double type.)r   rL   Údoubler/   s    r(   rê   z_StorageBase.double&  ó   € à�xŠx�œÑ%Ô%Ð%r*   c                ó@   — |                       t          j        ¦  «        S ©z!Casts this storage to float type.)r   rL   Úfloatr/   s    r(   rî   z_StorageBase.float*  ó   € à�xŠx�œÑ$Ô$Ð$r*   c                ó@   — |                       t          j        ¦  «        S ©z Casts this storage to half type.)r   rL   Úhalfr/   s    r(   rò   z_StorageBase.half.  ó   € à�xŠx�œ
Ñ#Ô#Ð#r*   c                ó@   — |                       t          j        ¦  «        S ©z Casts this storage to long type.)r   rL   Úlongr/   s    r(   rö   z_StorageBase.long2  ró   r*   c                ó@   — |                       t          j        ¦  «        S ©zCasts this storage to int type.)r   rL   Úintr/   s    r(   rù   z_StorageBase.int6  s   € à�xŠx�œ	Ñ"Ô"Ð"r*   c                ó@   — |                       t          j        ¦  «        S ©z!Casts this storage to short type.)r   rL   Úshortr/   s    r(   rü   z_StorageBase.short:  rï   r*   c                ó@   — |                       t          j        ¦  «        S ©z Casts this storage to char type.)r   rL   Úint8r/   s    r(   Úcharz_StorageBase.char>  ró   r*   c                ó@   — |                       t          j        ¦  «        S ©z Casts this storage to byte type.)r   rL   rá   r/   s    r(   Úbytez_StorageBase.byteB  rï   r*   c                ó@   — |                       t          j        ¦  «        S ©z Casts this storage to bool type.)r   rL   Úboolr/   s    r(   r  z_StorageBase.boolF  ró   r*   c                ó@   — |                       t          j        ¦  «        S ©z$Casts this storage to bfloat16 type.)r   rL   Úbfloat16r/   s    r(   r	  z_StorageBase.bfloat16J  s   € à�xŠx�œÑ'Ô'Ð'r*   c                ó@   — |                       t          j        ¦  «        S ©z*Casts this storage to complex double type.)r   rL   Úcdoubler/   s    r(   Úcomplex_doublez_StorageBase.complex_doubleN  s   € à�xŠx�œÑ&Ô&Ð&r*   c                ó@   — |                       t          j        ¦  «        S ©z)Casts this storage to complex float type.)r   rL   Úcfloatr/   s    r(   Úcomplex_floatz_StorageBase.complex_floatR  rë   r*   c                ó@   — |                       t          j        ¦  «        S ©z&Casts this storage to float8_e5m2 type)r   rL   Úfloat8_e5m2r/   s    r(   r  z_StorageBase.float8_e5m2V  s   € à�xŠx�Ô)Ñ*Ô*Ð*r*   c                ó@   — |                       t          j        ¦  «        S ©z(Casts this storage to float8_e4m3fn type)r   rL   Úfloat8_e4m3fnr/   s    r(   r  z_StorageBase.float8_e4m3fnZ  s   € à�xŠx�Ô+Ñ,Ô,Ð,r*   c                ó@   — |                       t          j        ¦  «        S ©z*Casts this storage to float8_e5m2fnuz type)r   rL   Úfloat8_e5m2fnuzr/   s    r(   r  z_StorageBase.float8_e5m2fnuz^  ó   € à�xŠx�Ô-Ñ.Ô.Ð.r*   c                ó@   — |                       t          j        ¦  «        S ©z*Casts this storage to float8_e4m3fnuz type)r   rL   Úfloat8_e4m3fnuzr/   s    r(   r  z_StorageBase.float8_e4m3fnuzb  r  r*   rI   úUnion[str, torch.device]c                óÀ   — t          j        g t           j        | j        ¬¦  «                             t          t          | ¦  «        ¦  «                             |¦  «        S )zäDetermine whether the CPU storage is already pinned on device.

        Args:
            device (str or torch.device): The device to pin memory on. Default: ``'cuda'``.

        Returns:
            A boolean variable.
        rÝ   )rL   rà   rá   r   râ   r   r   Ú	is_pinned©r%   r   s     r(   r!  z_StorageBase.is_pinnedf  sE   € õ ŒL˜¥5¤;°t´{ÐCÑCÔCßŠT•$•w Ñ%Ô%Ñ&Ô&ßŠY�vÑÔð	
r*   c                óR  — | j         j        dk    r%t          d|                      ¦   «         › d�¦  «        ‚t          j        g t          j        | j         ¬¦  «                             t          t          | ¦  «        ¦  «         	                    |¦  «        }| 
                    ¦   «         S )zêCopy the CPU storage to pinned memory, if it's not already pinned.

        Args:
            device (str or torch.device): The device to pin memory on. Default: ``'cuda'``.

        Returns:
            A pinned CPU storage.
        r×   zcannot pin 'z' only CPU memory can be pinnedrÝ   )r   rG   rß   rL   rà   rá   râ   r   r   Ú
pin_memoryÚuntyped_storage)r%   r   Úpinned_tensors      r(   r$  z_StorageBase.pin_memoryu  s�   € ð Œ;Ô˜uÒ$Ð$ÝÐW¨4¯9ª9©;¬;ÐWÐWÐWÑXÔXÐXõ ŒL˜¥5¤;°t´{ÐCÑCÔCßŠT•$•w Ñ%Ô%Ñ&Ô&ßŠZ˜ÑÔð 	ð
 ×,Ò,Ñ.Ô.Ð.r*   c                óÚ   — ddl m} | j        j        dt          j                             ¦   «         fv rn7 |¦   «         dk    r|                      ¦   «          n|                      ¦   «          | S )ú.See :meth:`torch.UntypedStorage.share_memory_`r   ©Úget_sharing_strategyrI   Úfile_system)	Útorch.multiprocessingr*  r   rG   rL   Ú_CÚ_get_privateuse1_backend_namer\   r^   )r%   r*  s     r(   Úshare_memory_z_StorageBase.share_memory_ˆ  sz   € à>Ð>Ð>Ð>Ð>Ð>àŒ;Ô ­¬×(NÒ(NÑ(PÔ(PÐQÐQÐQØØ!Ð!Ñ#Ô# }Ò4Ð4Ø×%Ò%Ñ'Ô'Ð'Ð'à×ÒÑ!Ô!Ð!Øˆr*   r×   rÐ   c               ó  — ddl m} t          j        |¦  «        }|j        dt          j                             ¦   «         dfv r | ||¬¦  «        S  |¦   «         dk    r|                      |¦  «        S |                      |¦  «        S )ú>Create a new storage in shared memory with the same data type.r   r)  rI   rQ   rÐ   r+  )	r,  r*  rL   r   rG   r-  r.  rc   rf   )r_   rC   r   r*  s       r(   Ú_new_sharedz_StorageBase._new_shared”  s˜   € ð 	?Ð>Ð>Ð>Ð>Ð>å”˜fÑ%Ô%ˆØŒ;˜6¥5¤8×#IÒ#IÑ#KÔ#KÈUÐSÐSÐSØ�3�t FÐ+Ñ+Ô+Ð+Ø!Ð!Ñ#Ô# }Ò4Ð4Ø×.Ò.¨tÑ4Ô4Ð4à×(Ò(¨Ñ.Ô.Ð.r*   c                ó   — | S r"   r#   r/   s    r(   Úuntypedz_StorageBase.untyped¡  s   € Øˆr*   c                ó¼   — t           j                             |¦  «        }|j        r t	          t          |dz  ¦  «        d¦  «        }|                      |¦  «         dS )zSwap bytes in underlying data.é   é   N)rL   Ú_utilsÚ_element_sizeÚ
is_complexÚmaxrù   r”   )r%   rD   Ú	elem_sizes      r(   Úbyteswapz_StorageBase.byteswap¤  sU   € å”L×.Ò.¨uÑ5Ô5ˆ	àÔð 	3Ý�C 	¨A¡Ñ.Ô.°Ñ2Ô2ˆIØ�Š�yÑ!Ô!Ð!Ð!Ð!r*   ©r+   r   r"   )r8   r   r9   r:   r+   r   )r+   r   ©NF)rD   rE   r9   r   r+   r   )r+   r   )r_   r`   rC   r   r+   r   )r_   r`   r+   r   )rC   r   ©r+   rE   )r   r   r9   r   ©rI   ©r   r  )TÚ__name__Ú
__module__Ú__qualname__Ú__annotations__r   r   r    r)   r0   r5   r7   r=   r?   rA   rC   rG   rI   rQ   rS   rV   rX   rZ   r\   r^   Úclassmethodrc   rf   ri   rm   ro   rq   rs   ru   rx   rz   r|   r~   r€   r‚   r„   r†   rˆ   ÚpropertyrŠ   rŒ   r�   r’   r”   r–   r®   r³   r¶   r»   rÇ   rË   rµ   rÔ   r×   rÚ   r   rM   rê   rî   rò   rö   rù   rü   r   r  r  r	  r  r  r  r  r  r  r!  r$  r/  r2  r4  r=  Ú__classcell__©rÍ   s   @r(   r   r   2   s]  ø€ € € € € € Ø€K€K�KØ€IÐÐÐÑØ €MÐ Ð Ð Ñ ØÐÐÑà,0€LÐ0Ð0Ð0Ñ0ðð ð ð"ð "ð "ð "ð"ð "ð "ð"ð "ð "ð"ð "ð "ð "ð "ð"ð "ð "ð "ð"ð "ð "ð "ðð ð ð ð CHð0ð 0ð 0ð 0ð 0ð ).ðBð Bð Bð Bð Bð"Bð Bð Bð Bð Bð"ð "ð "ð "ð!ð !ð !ð !ð"ð "ð "ð "ð"ð "ð "ð "ð"ð "ð "ð"ð "ð "ð ð"ð "ð "ñ „[ð"ð ð"ð "ð "ñ „[ð"ð ð"ð "ð "ñ „[ð"ð ð Øð	"ð 	"ð 	"ð 	"ð 	"ñ „[ð	"ð ð"ð "ð "ñ „[ð"ð ð"ð "ð "ñ „[ð"ð"ð "ð "ð "ð"ð "ð "ð"ð "ð "ð "ð"ð "ð "ð "ð"ð "ð "ð"ð "ð "ð"ð "ð "ð"ð "ð "ð "ð ð"ð "ð "ñ „[ð"ð"ð "ð "ð ð"ð "ñ „[ð"ð ð"ð "ñ „Xð"ð ð"ð "ñ „Xð"ð ð"ð "ð "ñ „[ð"ð ð"ð "ð "ñ „[ð"ð"ð "ð "ð"ð "ð "ð "ð*ð *ð *ð9ð 9ð 9ðð ð ðð ð ð3ð 3ð 3ð
2ð 2ð 2ð 2ð 2ðIð Ið Iðð ð ðð ð ðð ð ðð ð ð CHð /ð /ð /ð /ð /ð /ð
&ð &ð &ð%ð %ð %ð$ð $ð $ð$ð $ð $ð#ð #ð #ð%ð %ð %ð$ð $ð $ð%ð %ð %ð$ð $ð $ð(ð (ð (ð'ð 'ð 'ð&ð &ð &ð+ð +ð +ð-ð -ð -ð/ð /ð /ð/ð /ð /ð
ð 
ð 
ð 
ð 
ð/ð /ð /ð /ð /ð&
ð 
ð 
ð Ø).ð 
/ð 
/ð 
/ð 
/ñ „[ð
/ðð ð ð"ð "ð "ð "ð "ð "ð "r*   r   c                óF   ‡ — t          j        ‰ ¦  «        ˆ fd„¦   «         }|S )Nc                ó´  •— d }d }t           5  | j        }|t          v rt          |         }n<t          j        ¦   «         t          |<   t          |                              ¦   «          |}d d d ¦  «         n# 1 swxY w Y   |�|5  	 d d d ¦  «         n# 1 swxY w Y   	  ‰| g|¢R i |¤Ž|�T| j        |k    sJ ‚t           5  t          |                              ¦   «          t          |= d d d ¦  «         S # 1 swxY w Y   S S # |�T| j        |k    sJ ‚t           5  t          |                              ¦   «          t          |= d d d ¦  «         w # 1 swxY w Y   w w xY wr"   )Ú_share_memory_lockr   r   Ú	threadingÚRLockÚacquireÚrelease)r%   r&   r'   Úto_freeÚto_waitÚkeyÚfns         €r(   Úwrapperz-_share_memory_lock_protected.<locals>.wrapper®  s�  ø€ àˆØˆÝð 	ð 	Ø”+ˆCØÕ'Ð'Ð'Ý+¨CÔ0��å)2¬Ñ):Ô):Õ! #Ñ&Ý! #Ô&×.Ò.Ñ0Ô0Ð0Ø�ð	ð 	ð 	ñ 	ô 	ð 	ð 	ð 	ð 	ð 	ð 	øøøð 	ð 	ð 	ð 	ð ÐØð ð Øðð ð ñ ô ð ð ð ð ð ð øøøð ð ð ð ð	3Ø�2�dÐ,˜TÐ,Ð,Ð, VÐ,Ð,ð Ð"ð ”{ gÒ-Ð-Ð-Ð-Ý'ð 3ð 3Ý% gÔ.×6Ò6Ñ8Ô8Ð8Ý)¨'Ð2ð3ð 3ð 3ñ 3ô 3ð 3ð 3ð 3ð 3ð 3ð 3øøøð 3ð 3ð 3ð 3ð 3ð	 #øˆwÐ"ð ”{ gÒ-Ð-Ð-Ð-Ý'ð 3ð 3Ý% gÔ.×6Ò6Ñ8Ô8Ð8Ý)¨'Ð2ð3ð 3ð 3ñ 3ô 3ð 3ð 3ð 3ð 3ð 3ð 3øøøð 3ð 3ð 3ð 3ð 3ð	 #øøøsf   �AA4Á4A8Á;A8ÂBÂBÂBÂC? Â>(C2Ã2C6	Ã9C6	Ã?EÄ(E
Ä>EÅ
EÅEÅEÅE)Ú	functoolsÚwraps)rU  rV  s   ` r(   Ú_share_memory_lock_protectedrY  ­  s8   ø€ Ý„_�RÑÔð3ð 3ð 3ð 3ñ Ôð3ð> €Nr*   c                  ó°   ‡ — e Zd Zˆ fd„Zed„ ¦   «         Zed„ ¦   «         Zed
d„¦   «         Zeˆ fd„¦   «         Z	eˆ fd„¦   «         Z
eˆ fd	„¦   «         Zˆ xZS )r   c                ót   •— | j         j        dk    rt          d¦  «        ‚ t          ¦   «         j        |i |¤ŽS )Nr›   ú$Not available for 'meta' device type)r   rG   r.   rÊ   r5   ©r%   r&   r'   rÍ   s      €r(   r5   zUntypedStorage.__getitem__Ò  s>   ø€ ØŒ;Ô˜vÒ%Ð%Ý%Ð&LÑMÔMÐMØ"�u‰wŒwÔ" DÐ3¨FÐ3Ð3Ð3r*   c                ó"   — | j         j        dk    S ©NrI   ©r   rG   r/   s    r(   rŠ   zUntypedStorage.is_cuda×  s   € àŒ{Ô 6Ò)Ð)r*   c                ó"   — | j         j        dk    S ©NrQ   r`  r/   s    r(   rŒ   zUntypedStorage.is_hpuÛ  s   € àŒ{Ô 5Ò(Ð(r*   r+   rE   c                ó*   — |                       ¦   «         S )z÷Returns the file name associated with this storage.

        The file name will be a string if the storage is on CPU and was created via
        :meth:`~torch.from_file()` with ``shared`` as ``True``. This attribute is ``None`` otherwise.
        )r–   r/   s    r(   rŽ   zUntypedStorage.filenameß  s   € ð ×!Ò!Ñ#Ô#Ð#r*   c                ó6   •—  t          ¦   «         j        |i |¤ŽS )a{  
        Moves the storage to shared memory.

        This is a no-op for storages already in shared memory and for CUDA
        storages, which do not need to be moved for sharing across processes.
        Storages in shared memory cannot be resized.

        Note that to mitigate issues like `this <https://github.com/pytorch/pytorch/issues/95606>`_
        it is thread safe to call this function from multiple threads on the same object.
        It is NOT thread safe though to call any other function on self without proper
        synchronization. Please see :doc:`/notes/multiprocessing` for more details.

        .. note::
            When all references to a storage in shared memory are deleted, the associated shared memory
            object will also be deleted. PyTorch has a special cleanup process to ensure that this happens
            even if the current process exits unexpectedly.

            It is worth noting the difference between :meth:`share_memory_` and :meth:`from_file` with ``shared = True``

            #. ``share_memory_`` uses `shm_open(3) <https://man7.org/linux/man-pages/man3/shm_open.3.html>`_ to create a
               POSIX shared memory object while :meth:`from_file` uses
               `open(2) <https://man7.org/linux/man-pages/man2/open.2.html>`_ to open the filename passed by the user.
            #. Both use an `mmap(2) call <https://man7.org/linux/man-pages/man2/mmap.2.html>`_ with ``MAP_SHARED``
               to map the file/object into the current virtual address space
            #. ``share_memory_`` will call ``shm_unlink(3)`` on the object after mapping it to make sure the shared memory
               object is freed when no process has the object open. ``torch.from_file(shared=True)`` does not unlink the
               file. This file is persistent and will remain until it is deleted by the user.

        Returns:
            ``self``
        )rÊ   r/  r]  s      €r(   r/  zUntypedStorage.share_memory_è  s"   ø€ ðB %�u‰wŒwÔ$ dÐ5¨fÐ5Ð5Ð5r*   c                ó6   •—  t          ¦   «         j        |i |¤ŽS r"   )rÊ   r^   r]  s      €r(   r^   zUntypedStorage._share_fd_cpu_  s   ø€ à%�u‰wŒwÔ% tÐ6¨vÐ6Ð6Ð6r*   c                ó6   •—  t          ¦   «         j        |i |¤ŽS r"   )rÊ   r\   r]  s      €r(   r\   z#UntypedStorage._share_filename_cpu_  s   ø€ à+�u‰wŒwÔ+¨TÐ<°VÐ<Ð<Ð<r*   r@  )rC  rD  rE  r5   rH  rŠ   rŒ   rŽ   rY  r/  r^   r\   rI  rJ  s   @r(   r   r   Ñ  s  ø€ € € € € ð4ð 4ð 4ð 4ð 4ð
 ð*ð *ñ „Xð*ð ð)ð )ñ „Xð)ð ð$ð $ð $ñ „Xð$ð "ð 6ð  6ð  6ð  6ñ "Ô!ð 6ðD "ð7ð 7ð 7ð 7ñ "Ô!ð7ð "ð=ð =ð =ð =ñ "Ô!ð=ð =ð =ð =ð =r*   c                óR   — t          j        t          j        | ¦  «        d¬¦  «        S )NF)Úweights_only)rL   ÚloadrÀ   rÁ   )rÆ   s    r(   rÃ   rÃ     s   € ÝŒ:•b”j ‘m”m°%Ð8Ñ8Ô8Ð8r*   )Úmaxsizec                 ó$  — t           j        t           j        t           j        t           j        t           j        t           j        t           j        t           j        t           j	        t           j
        t           j        t           j        t           j        hS r"   )rL   r  r  r  r  Úbits8Úbits16Úbits1x8Úbits2x4Úbits4x2Ú	complex32Úuint16Úuint32Úuint64r#   r*   r(   Ú_new_dtypesru    sS   € õ
 	ÔÝÔÝÔÝÔÝŒÝŒÝŒÝŒÝŒÝŒÝŒÝŒÝŒðð r*   c                 óÀ  — i t           j        d“t           j        d“t           j        d“t           j        d“t           j        d“t           j        d“t           j        d“t           j        d“t           j	        d	“t           j
        d
“t           j        d“t           j        d“t           j        d“t           j        d“t           j        d“t           j        d“t           j        d“S )NÚDoubleStorageÚFloatStorageÚHalfStorageÚLongStorageÚ
IntStorageÚShortStorageÚCharStorageÚByteStorageÚBoolStorageÚBFloat16StorageÚComplexDoubleStorageÚComplexFloatStorageÚQInt8StorageÚQInt32StorageÚQUInt8StorageÚQUInt4x2StorageÚQUInt2x4Storage)rL   rê   rî   rò   rö   rù   Úint16rÿ   rá   r  r	  r  r  Úqint8Úqint32Úquint8Úquint4x2Úquint2x4r#   r*   r(   Ú_dtype_to_storage_type_maprŽ  -  sû   € ðÝŒ�oðåŒ�^ðõ 	Œ
�Mðõ 	Œ
�Mð	õ
 	Œ	�<ðõ 	Œ�^ðõ 	Œ
�Mðõ 	Œ�]ðõ 	Œ
�Mðõ 	ŒÐ)ðõ 	ŒÐ-ðõ 	ŒÐ+ðõ 	Œ�^ðõ 	Œ�oðõ 	Œ�oðõ  	ŒÐ)ð!õ" 	ŒÐ)ð#ð r*   c                 óZ   — d„ t          ¦   «                              ¦   «         D ¦   «         } | S )Nc                ó   — i | ]\  }}||“Œ	S r#   r#   )r£   rT  Úvals      r(   ú
<dictcomp>z._storage_type_to_dtype_map.<locals>.<dictcomp>K  s   € ÐOÐOÐO™h˜c 3��cÐOÐOÐOr*   )rŽ  Úitems)Ú	dtype_maps    r(   Ú_storage_type_to_dtype_mapr•  I  s.   € àOÐOÕ*DÑ*FÔ*F×*LÒ*LÑ*NÔ*NÐOÑOÔO€IØÐr*   c           
     óô  — |t           j        t           j        t           j        t           j        t           j        fv rŽt           j        t           j        t           j        t           j        t           j        t           j        t           j        t           j        t           j        t           j        i}t          j	        | ||         |¬¦  «        }nt          j	        | ||¬¦  «        }| 
                    ¦   «         j        S )NrÝ   )rL   r‹  rŒ  r�  rŠ  r‰  rá   Úint32rÿ   rà   rã   Ú_untyped_storage)ÚsequencerD   r   Úinterpret_dtypesÚ
tmp_tensors        r(   Ú_get_storage_from_sequencerœ  O  s¸   € ØÝŒÝŒÝŒÝŒÝŒðð ð õ ŒL�%œ+ÝŒN�EœKÝŒN�EœKÝŒL�%œ+ÝŒK�œð
Ðõ ”\ØÐ,¨UÔ3¸Fð
ñ 
ô 
ˆ
ˆ
õ
 ”\ (°%ÀÐGÑGÔGˆ
à×$Ò$Ñ&Ô&Ô7Ð7r*   c                ó|   — t           r!t          | t          t          j        f¦  «        S t          | t          ¦  «        S r"   )Ú	HAS_NUMPYrÞ   rù   ÚnpÚinteger)Úxs    r(   Ú_isintr¢  h  s1   € Ýð "Ý˜!�c¥2¤:Ð.Ñ/Ô/Ð/å˜!�SÑ!Ô!Ð!r*   c                 ó   — t           S r"   )Ú"_always_warn_typed_storage_removalr#   r*   r(   Ú&_get_always_warn_typed_storage_removalr¥  r  s   € Ý-Ð-r*   c                ó8   — t          | t          ¦  «        sJ ‚| ad S r"   )rÞ   r  r¤  )Úalways_warns    r(   Ú&_set_always_warn_typed_storage_removalr¨  v  s$   € å�k¥4Ñ(Ô(Ð(Ð(Ð(Ø)4Ð&Ð&Ð&r*   r6  c                ó    — d„ }t          ¦   «         s
 |¦   «         r2d}t          j        |t          | dz   ¬¦  «         dt          j        d<   d S d S )Nc                 óV   — t          t          d¦  «        sdS t          j        d          S )NÚ
has_warnedT)ÚhasattrÚ_warn_typed_storage_removalÚ__dict__r#   r*   r(   Úis_first_timez2_warn_typed_storage_removal.<locals>.is_first_time  s,   € ÝÕ2°LÑAÔAð 	JØ�4å2Ô;¸LÔIÐIÐIr*   a  TypedStorage is deprecated. It will be removed in the future and UntypedStorage will be the only storage class. This should only matter to you if you are using storages directly.  To access UntypedStorage directly, use tensor.untyped_storage() instead of tensor.storage()r7  )Ú
stacklevelTr«  )r¥  ÚwarningsÚwarnÚUserWarningr­  r®  )r°  r¯  Úmessages      r(   r­  r­  |  s{   € ðJð Jð Jõ .Ñ/Ô/ð B°=°=±?´?ð BðQð 	õ 	Œ�g�{°zÀA±~ÐFÑFÔFÐFØ=AÕ#Ô,¨\Ñ:Ð:Ð:ðBð Br*   c                 ó$   — dt           j        d<   d S )NFr«  )r­  r®  r#   r*   r(   Ú!_reset_warn_typed_storage_removalr¶  �  s   € Ø9>ÕÔ(¨Ñ6Ð6Ð6r*   Úmoduler¡   c                óˆ   — |                       dd¦  «        d         }|dt          j                             ¦   «         dfv r|S dS )Nú.r7  éÿÿÿÿrI   rQ   r×   )ÚrsplitrL   r-  r.  )r·  Ú	last_parts     r(   Ú_get_device_from_moduler½  ”  sE   € Ø—’˜c 1Ñ%Ô% bÔ)€IØ�V�UœX×CÒCÑEÔEÀuÐMÐMÐMØÐàˆur*   c                  ó|  ‡ — e Zd ZU dZded<   dZded<   ded<   ed	„ ¦   «         Zedtd„¦   «         Zd„ Z	dddddœˆ fd„
Z
dddddœd„Zed„ ¦   «         Zed„ ¦   «         Zd„ Zdud„Zd„ Zdvd„Zd„ Zd„ Zd„ Zd„ Zdwdxd!„Zd"„ Zd#„ Z	 	 dydzd&„Zdydud'„Zdydud(„Zdd)œd{d,„Zd-„ Zd.„ Zd|d0„Zd1„ Z d2„ Z!d3„ Z"d4„ Z#d5„ Z$d6„ Z%ˆ fd7„Z&d8„ Z'd9„ Z(d:„ Z)d}d~d=„Z*d}d~d>„Z+d?„ Z,d@„ Z-ddAœdB„Z.edC„ ¦   «         Z/edD„ ¦   «         Z0dE„ Z1dF„ Z2dG„ Z3dH„ Z4dI„ Z5dJ„ Z6dK„ Z7dL„ Z8dM„ Z9dN„ Z:e;dO„ ¦   «         Z<dP„ Z=e;dQ„ ¦   «         Z>e;dddRœdS„¦   «         Z?dT„ Z@dU„ ZAdV„ ZBdW„ ZCdX„ ZDdY„ ZEdZ„ ZFd[„ ZGd\„ ZHd]„ ZId^„ ZJd_„ ZKd`„ ZLda„ ZMdb„ ZNdc„ ZOdd„ ZPe;de„ ¦   «         ZQe;df„ ¦   «         ZRdg„ ZSdh„ ZTdi„ ZUdj„ ZVdk„ ZWdl„ ZXe;dm„ ¦   «         ZYdn„ ZZdo„ Z[e;ddAœdp„¦   «         Z\dq„ Z]dr„ Z^ds„ Z_ˆ xZ`S )r   Fr   r   Nr   r    útorch.dtyperD   c                ó   — | j         S r"   )rD   r/   s    r(   Ú_dtypezTypedStorage._dtype£  s
   € àŒzÐr*   r+   rE   c                ó   — | j         j        S )z­Returns the file name associated with this storage if the storage was memory mapped from a file.
        or ``None`` if the storage was not created by memory mapping a file.)r˜  rŽ   r/   s    r(   rŽ   zTypedStorage.filename§  s   € ð Ô$Ô-Ð-r*   c                óŽ   — t          ¦   «          |                      t          d|                      ¦   «         ¦  «        |¦  «         | S )Nr   )r­  Ú_setitemÚsliceÚ_size)r%   Úvalues     r(   Úfill_zTypedStorage.fill_­  s9   € Ý#Ñ%Ô%Ð%Ø�Š•e˜A˜tŸzšz™|œ|Ñ,Ô,¨eÑ4Ô4Ð4Øˆr*   )Úwrap_storagerD   r   Ú	_internalc               ó  •— |st          ¦   «          | t          j        j        k    rt	          d¦  «        ‚| t
          k    r!t          ¦   «                              | ¦  «        S | › d�}|�t	          |dz   ¦  «        ‚|�t	          |dz   ¦  «        ‚|€¿t          |¦  «        dk    rt	          |dz   ¦  «        ‚t          |¦  «        dk    rbt          |d         ¦  «        sMt          |d         t          j        j        ¦  «        s(t          |dt          |d         ¦  «        › �z   ¦  «        ‚t          || j        t#          | j        ¦  «        d	d
œŽS t          |¦  «        dk    rt	          |dz   ¦  «        ‚t          |t          j        ¦  «        s"t          |dt          |¦  «        › �z   ¦  «        ‚t#          | j        ¦  «        }|j        j        |k    r"t	          |d|› d|j        j        › �z   ¦  «        ‚t          ||| j        d	dœŽS )Nz8Only child classes of _LegacyStorage can be instantiatedzœ.__new__ received an invalid combination of arguments. Expected one of:
 * no arguments
 * (int size)
 * (Sequence data)
 * (*, UntypedStorage wrap_storage)z.
Keyword argument 'device' cannot be specifiedz-
Keyword argument 'dtype' cannot be specifiedr7  ú
Too many positional argumentsr   ú
Argument type not recognized: T)rD   r   rÊ  úB
No positional arguments should be given when using 'wrap_storage'ú9
Argument 'wrap_storage' must be UntypedStorage, but got z"
Device of 'wrap_storage' must be z
, but got ©rÉ  rD   rÊ  )r­  rL   rå   Ú_LegacyStorageÚRuntimeErrorr   rÊ   Ú__new__r¨   r¢  rÞ   ÚcollectionsÚabcÚSequencerß   rG   rÁ  r½  rD  r   r   rD   )	r_   rÉ  rD   r   rÊ  r&   Úarg_error_msgÚ
cls_devicerÍ   s	           €r(   rÓ  zTypedStorage.__new__²  s—  ø€ ð ð 	*Ý'Ñ)Ô)Ð)à•%”-Ô.Ò.Ð.ÝØJñô ð ð •,ÒÐÝ‘7”7—?’? 3Ñ'Ô'Ð'ð ð 6ð 6ð 6ð ð Ð!Ý"Ø!Ð$UÑUñô ð ð Ð Ý"Ø!Ð$TÑTñô ð ð Ð#Ý�t‘9”9˜q’=�=Ý&Ø%Ð(IÑIñô ð õ
 ˜‘I”I ’N�NÝ" 4¨¤7™OœOð #å& t¨A¤wµ´Ô0HÑIÔIð #õ $Ø%ØL½TÀ$ÀqÄ'¹]¼]ÐLÐLñMñô ð õ
 $ØØœ*Ý2°3´>ÑBÔBØ"ð	ð ð ð õ �t‘9”9 ’>�>Ý&Ø%ð)ñ)ñô ð õ " ,µÔ0DÑEÔEð Ý#Ø%ØkÕW[Ð\hÑWiÔWiÐkÐkñlñô ð õ
 5°S´^ÑDÔD�
àÔ&Ô+¨zÒ9Ð9Ý&Ø%ð@À
ð @ð @Ø%1Ô%8Ô%=ð@ð @ñ@ñô ð õ $ØØ!-Øœ)Ø"ð	ð ð ð r*   )r   rD   rÉ  rÊ  c               ó,  — |st          ¦   «          d}|�Õt          |¦  «        dk    rt          |dz   ¦  «        ‚|€t          |dz   ¦  «        ‚t          |t          j        ¦  «        s"t          |dt          |¦  «        › �z   ¦  «        ‚|�t          |dz   ¦  «        ‚|| _        t          |t          j        ¦  «        s"t          |dt          |¦  «        › �z   ¦  «        ‚|| _	        d S |€t	          j
        ¦   «         n|| _        t	          j        |€dn|¦  «        }| j        t          j        t          j        t          j        t          j        t          j        fv r|j        d	k    rt          d
¦  «        ‚t          |¦  «        dk    rt	          j        |¬¦  «        | _	        d S t          |¦  «        dk    rÊt#          |d         ¦  «        rEt	          j        t%          |d         ¦  «        |                      ¦   «         z  |¬¦  «        | _	        d S t          |d         t(          j        j        ¦  «        r#t/          |d         | j        |¦  «        | _	        d S t          |dt          |d         ¦  «        › �z   ¦  «        ‚t          |dz   ¦  «        ‚)Na1  TypedStorage.__init__ received an invalid combination of arguments. Expected one of:
 * (*, torch.device device, torch.dtype dtype)
 * (int size, *, torch.device device, torch.dtype dtype)
 * (Sequence data, *, torch.device device, torch.dtype dtype)
 * (*, UntypedStorage wrap_storage, torch.dtype dtype)r   rÎ  z#
Argument 'dtype' must be specifiedz+
Argument 'dtype' must be torch.dtype, not zG
Argument 'device' should not be specified when 'wrap_storage' is givenrÏ  r×   rI   ú/Cannot create CUDA storage with quantized dtyperÐ   r7  rÍ  rÌ  )r­  r¨   rÒ  rÞ   rL   rD   rß   rG   r   r˜  Úget_default_dtyper   r‹  rŒ  r�  rŠ  r‰  r¢  rù   r9  rÔ  rÕ  rÖ  rœ  )r%   r   rD   rÉ  rÊ  r&   r×  s          r(   r)   zTypedStorage.__init__  sÜ  € ð ð 	*Ý'Ñ)Ô)Ð)ðEð 	ð Ð#Ý�4‰yŒy˜AŠ~ˆ~Ý"Ø!ð%ñ%ñô ð ð ˆ}Ý"Ø!Ð$JÑJñô ð õ ˜e¥U¤[Ñ1Ô1ð ÝØ!ØRÅTÈ%Á[Ä[ÐRÐRñSñô ð ð
 Ð!Ý"Ø!Ø`ñañô ð ð
 ˆDŒJå˜l­EÔ,@ÑAÔAð ÝØ!ØgÕSWÐXdÑSeÔSeÐgÐgñhñô ð ð
 %1ˆDÔ!Ð!Ð!ð 7<°m�Ô0Ñ2Ô2Ð2ÈˆDŒJÝ”\¨6¨> % %¸vÑFÔFˆFàŒzÝ”Ý”Ý”Ý”Ý”ðð ð ð ”; &Ò(Ð(Ý&ØIñô ð õ �4‰yŒy˜AŠ~ˆ~Ý(-Ô(<ÀFÐ(KÑ(KÔ(K�Ô%Ð%Ð%å�T‘”˜a’�Ý˜$˜qœ'‘?”?ð Ý,1Ô,@Ý˜D œG™œ t×'9Ò'9Ñ';Ô';Ñ;ÀFð-ñ -ô -�DÔ)Ð)Ð)õ    Q¤­¬Ô)AÑBÔBð Ý,FØ˜Qœ ¤¨Vñ-ô -�DÔ)Ð)Ð)õ $Ø%ØL½TÀ$ÀqÄ'¹]¼]ÐLÐLñMñô ð õ # =Ð3TÑ#TÑUÔUÐUr*   c                óH   — t          ¦   «          | j        j        j        dk    S r_  ©r­  r˜  r   rG   r/   s    r(   rŠ   zTypedStorage.is_cudai  s"   € å#Ñ%Ô%Ð%ØÔ$Ô+Ô0°FÒ:Ð:r*   c                óH   — t          ¦   «          | j        j        j        dk    S rb  rÝ  r/   s    r(   rŒ   zTypedStorage.is_hpun  s"   € å#Ñ%Ô%Ð%ØÔ$Ô+Ô0°EÒ9Ð9r*   c                ó,   — t          ¦   «          | j        S )z2Return the internal :class:`torch.UntypedStorage`.)r­  r˜  r/   s    r(   r4  zTypedStorage.untypeds  s   € å#Ñ%Ô%Ð%ØÔ$Ð$r*   r   c                óö   — t          |¦  «        t          j        k    sJ ‚t          | ¦  «        t          k    r*t	          t
          t          || j        d¬¦  «        ¦  «        S  t          | ¦  «        |¬¦  «        S )NTrÐ  ©rÉ  )rG   rL   r   r   r   r   rD   )r%   r%  s     r(   Ú_new_wrapped_storagez!TypedStorage._new_wrapped_storagex  sz   € Ý�OÑ$Ô$­Ô(<Ò<Ð<Ð<Ð<å�‰:Œ:�Ò%Ð%ÝÝÝØ!0¸¼
Èdðñ ô ñô ð ð •4˜‘:”:¨?Ð;Ñ;Ô;Ð;r*   c                óF   — t          ¦   «          |                      ¦   «         S r"   ©r­  rÆ  r/   s    r(   r0   zTypedStorage.__len__…  ó   € Ý#Ñ%Ô%Ð%Ø�zŠz‰|Œ|Ðr*   c                ó”  — |€|r|                       ¦   «         S dS t          |¦  «        t          k    r/t          dt          | ¦  «        › dt          |¦  «        › �¦  «        ‚|rw||                       ¦   «         k    s||                       ¦   «          k     r't	          d|› d|                      ¦   «         › �¦  «        ‚|dk    r|S ||                       ¦   «         z  S ||                       ¦   «         k    s||                       ¦   «          k     r't	          d|› d|                      ¦   «         › �¦  «        ‚||                       ¦   «         z  S )Nr   úcan't index a ú with zindex z" out of range for storage of size )rÆ  rG   rù   rß   Ú
IndexErrorrC   )r%   r4   Úis_stops      r(   Ú_maybe_wrap_indexzTypedStorage._maybe_wrap_index‰  sH  € Øˆ;Øð Ø—z’z‘|”|Ð#à�qõ �C‰yŒy�CÒÐÝÐ Nµ°d±´Ð NÐ NÅ4ÈÁ9Ä9Ð NÐ NÑOÔOÐOØð *Ø˜$Ÿ*š*™,œ,Ò&Ð&¨C°4·:²:±<´<°-Ò,?Ð,?Ý$ØU ÐUÐUÈÏ	Ê	ÉÌÐUÐUñô ð ð ˜’7�7Ø�Jà §¢¡¤Ñ-Ð-à˜4Ÿ:š:™<œ<Ò'Ð'¨S°D·J²J±L´L°=Ò-@Ð-@Ý$ØU ÐUÐUÈÏ	Ê	ÉÌÐUÐUñô ð ð ˜TŸZšZ™\œ\Ñ)Ð)r*   c                óJ   — t          ¦   «          |                      ||¦  «        S r"   )r­  rÄ  )r%   r4   rÇ  s      r(   r7   zTypedStorage.__setitem__£  s"   € Ý#Ñ%Ô%Ð%Ø�}Š}˜S %Ñ(Ô(Ð(r*   c           
     ó�  — t          |t          t          f¦  «        s/t          dt	          | ¦  «        › dt	          |¦  «        › �¦  «        ‚t          j        |¦  «        rt          dt	          |¦  «        › �¦  «        ‚| j        t
          j        t
          j	        t
          j
        t
          j        t
          j        fv rÉt
          j        t
          j        t
          j	        t
          j        t
          j
        t
          j        t
          j        t
          j        t
          j        t
          j        i}|| j                 }t          j        g || j        j        ¬¦  «        }|                     t)          | j        |d¬¦  «        ¦  «         n9t          j        g | j        | j        j        ¬¦  «                             | ¦  «        }|||<   d S )Nrç  rè  z cannot set item with value type rÝ   TrÐ  )rÞ   rù   rÅ  rÒ  rG   rL   Ú
is_storagerD   r‹  rŒ  r�  rŠ  r‰  rá   r—  rÿ   rà   r˜  r   râ   r   )r%   r4   rÇ  rš  Ú	tmp_dtyper›  s         r(   rÄ  zTypedStorage._setitem§  sˆ  € Ý˜#¥¥U˜|Ñ,Ô,ð 	OÝÐMµ°T±
´
ÐMÐMÅ$ÀsÁ)Ä)ÐMÐMÑNÔNÐNÝÔ˜EÑ"Ô"ð 	QÝÐOÅ$ÀuÁ+Ä+ÐOÐOÑPÔPÐPØŒ:ÝŒLÝŒNÝŒNÝŒLÝŒKð
ð 
ð 
õ ”�eœkÝ”¥¤Ý”¥¤Ý”�eœkÝ”�UœZð Ðð )¨¬Ô4ˆIÝœØ˜)¨DÔ,AÔ,Hðñ ô ˆJð �OŠOÝØ!%Ô!6¸iÐSWðñ ô ñô ð ð õ œØ˜$œ*¨TÔ-BÔ-Iðñ ô çŠd�4‰jŒjð ð  ˆ
�3‰ˆˆr*   c                óH   — t          ¦   «          |                      |¦  «        S r"   )r­  Ú_getitemr3   s     r(   r5   zTypedStorage.__getitem__Ê  s    € Ý#Ñ%Ô%Ð%Ø�}Š}˜SÑ!Ô!Ð!r*   c           
     ó  — | j         j        j        dk    rt          d¦  «        ‚t	          |t
          ¦  «        rt          d¦  «        ‚t	          |t          ¦  «        s/t          dt          | ¦  «        › dt          |¦  «        › �¦  «        ‚| j        t          j
        t          j        t          j        t          j        t          j        fv r¥t          j
        t          j        t          j        t          j        t          j        t          j        t          j        t          j        t          j        t          j        i}t%          | j         || j                 d¬¦  «                             |¦  «        S |                      |¦  «        }dd	lm}  |¦   «         5  t          j        g | j        | j         j        ¬
¦  «                             | ¦  «        }||                              ¦   «         cd d d ¦  «         S # 1 swxY w Y   d S )Nr›   r\  z7slices are only supported in UntypedStorage.__getitem__rç  rè  TrÐ  r   )Úunset_fake_temporarilyrÝ   )r˜  r   rG   r.   rÞ   rÅ  rÒ  rù   rD   rL   r‹  rŒ  r�  rŠ  r‰  rá   r—  rÿ   r   rñ  rë  Útorch._subclasses.fake_tensorró  rà   râ   Úitem)r%   r4   rš  Úidx_wrappedró  r›  s         r(   rñ  zTypedStorage._getitemÎ  s  € ØÔ Ô'Ô,°Ò6Ð6Ý%Ð&LÑMÔMÐMõ �c�5Ñ!Ô!ð 	OÝØIñô ð õ ˜C¥Ñ%Ô%ð 	OÝÐMµ°T±
´
ÐMÐMÅ$ÀsÁ)Ä)ÐMÐMÑNÔNÐNàŒ:ÝŒLÝŒNÝŒNÝŒLÝŒKð
ð 
ð 
õ ”�eœkÝ”¥¤Ý”¥¤Ý”�eœkÝ”�UœZð Ðõ  Ø!Ô2Ø& t¤zÔ2Øðñ ô ÷ Šh�s‰mŒmð	ð ×,Ò,¨SÑ1Ô1ˆØHÐHÐHÐHÐHÐHà#Ð#Ñ%Ô%ð 	2ð 	2ÝœØ˜$œ*¨TÔ-BÔ-Iðñ ô çŠd�4‰jŒjð ð ˜kÔ*×/Ò/Ñ1Ô1ð		2ð 	2ð 	2ð 	2ñ 	2ô 	2ð 	2ð 	2ð 	2ð 	2ð 	2ð 	2øøøð 	2ð 	2ð 	2ð 	2ð 	2ð 	2s   ÆAG7Ç7G;Ç>G;r8   r   r9   ú_Optional[bool]c                óÄ   — t          ¦   «          t          |t          ¦  «        r!| j                             |j        |¦  «         n| j                             ||¦  «         | S r"   )r­  rÞ   r   r˜  r=   r<   s      r(   r=   zTypedStorage.copy_ú  s]   € Ý#Ñ%Ô%Ð%Ý�f�lÑ+Ô+ð 	>ØÔ!×'Ò'¨Ô(?ÀÑNÔNÐNÐNàÔ!×'Ò'¨°Ñ=Ô=Ð=Øˆr*   c                óF   — t          ¦   «          |                      ¦   «         S r"   )r­  Ú_nbytesr/   s    r(   rA   zTypedStorage.nbytes  s   € Ý#Ñ%Ô%Ð%Ø�|Š|‰~Œ~Ðr*   c                ó4   — | j                              ¦   «         S r"   )r˜  rA   r/   s    r(   rú  zTypedStorage._nbytes  s   € ØÔ$×+Ò+Ñ-Ô-Ð-r*   r  ú&Union[_StorageBase, TypedStorage, str]c                ó  — t          ¦   «          |€V|                      ¦   «         }|�|j        dz   |j        z   S d                     | j        t          | ¦  «        j        g¦  «        S | j                             ||¦  «        S )Nr¹  )r­  Ú_get_legacy_storage_classrD  rC  r©   rG   r˜  )r%   rD   r9   Úlegacy_classs       r(   rG   zTypedStorage.type
  s   € õ
 	$Ñ%Ô%Ð%Øˆ=Ø×9Ò9Ñ;Ô;ˆLàÐ'Ø#Ô.°Ñ4°|Ô7LÑLÐLà—8’8˜Tœ_­d°4©j¬jÔ.AÐBÑCÔCÐCð Ô(×-Ò-¨e°\ÑBÔBÐBr*   c                ó  — t          ¦   «          | j        t          j        t          j        t          j        t          j        t          j        fv rt          d¦  «        ‚| j	         
                    ||¦  «        }|                      |¦  «        S )NrÚ  )r­  rD   rL   r‹  rŒ  r�  rŠ  r‰  rÒ  r˜  rI   râ  )r%   r   r9   Úcuda_storages       r(   rI   zTypedStorage.cuda  sx   € Ý#Ñ%Ô%Ð%ØŒ:ÝŒLÝŒNÝŒNÝŒLÝŒKð
ð 
ð 
õ ÐPÑQÔQÐQØÔ,×1Ò1°&¸,ÑGÔGˆØ×(Ò(¨Ñ6Ô6Ð6r*   c                ó  — t          ¦   «          | j        t          j        t          j        t          j        t          j        t          j        fv rt          d¦  «        ‚| j	         
                    ||¦  «        }|                      |¦  «        S )Nz.Cannot create HPU storage with quantized dtype)r­  rD   rL   r‹  rŒ  r�  rŠ  r‰  rÒ  r˜  rQ   râ  )r%   r   r9   Úhpu_storages       r(   rQ   zTypedStorage.hpu(  sx   € Ý#Ñ%Ô%Ð%ØŒ:ÝŒLÝŒNÝŒNÝŒLÝŒKð
ð 
ð 
õ ÐOÑPÔPÐPØÔ+×/Ò/°¸ÑEÔEˆØ×(Ò(¨Ñ5Ô5Ð5r*   ræ   r   r   c               ó°  — t          ¦   «          t          |t          j        ¦  «        st          j        |¦  «        }| j        t          j        t          j        t          j        t          j        t          j	        fv r*t          d|j                             ¦   «         › d�¦  «        ‚| j                             ||¬¦  «        }|                      |¦  «        S )NzCannot create z storage with quantized dtyperJ   )r­  rÞ   rL   r   rD   r‹  rŒ  r�  rŠ  r‰  rÒ  rG   Úupperr˜  rM   râ  )r%   r   r9   Ú
to_storages       r(   rM   zTypedStorage.to5  s¿   € Ý#Ñ%Ô%Ð%Ý˜&¥%¤,Ñ/Ô/ð 	*Ý”\ &Ñ)Ô)ˆFØŒ:ÝŒLÝŒNÝŒNÝŒLÝŒKð
ð 
ð 
õ ØS ¤×!2Ò!2Ñ!4Ô!4ÐSÐSÐSñô ð ð Ô*×-Ò-°VÈ,Ð-ÑWÔWˆ
Ø×(Ò(¨Ñ4Ô4Ð4r*   c                óF   — t          ¦   «          |                      ¦   «         S r"   )r­  r9  r/   s    r(   rS   zTypedStorage.element_sizeF  s    € Ý#Ñ%Ô%Ð%Ø×!Ò!Ñ#Ô#Ð#r*   c                óJ   — t           j                             | j        ¦  «        S r"   )rL   r8  r9  rD   r/   s    r(   r9  zTypedStorage._element_sizeK  s   € ÝŒ|×)Ò)¨$¬*Ñ5Ô5Ð5r*   r   c                óP   — t          ¦   «          | j                             ¦   «         S r"   )r­  r˜  rV   r/   s    r(   rV   zTypedStorage.get_deviceN  s#   € Ý#Ñ%Ô%Ð%ØÔ$×/Ò/Ñ1Ô1Ð1r*   c           
     óP  ‡ — t          ¦   «          dt          j        ‰ ¦  «        › d‰ j        › d‰ j        › dt          ‰ ¦  «        › d�	}‰ j        j        dk    rd|z   S dd	                     ˆ fd
„t          ‰  	                    ¦   «         ¦  «        D ¦   «         ¦  «        z   }|dz   |z   S )Nr˜   z(dtype=z	, device=r™   rš   r›   rœ   r�   rž   c              3  óB   •K  — | ]}t          ‰|         ¦  «        V — Œd S r"   r    r¢   s     €r(   r¥   z'TypedStorage.__str__.<locals>.<genexpr>[  s-   øè è € Ð'QÐ'Q¸­¨D°¬G©¬Ð'QÐ'QÐ'QÐ'QÐ'QÐ'Qr*   r¦   )
r­  rL   r§   rD   r   r¨   rG   r©   rª   rC   r«   s   `  r(   Ú__str__zTypedStorage.__str__R  sË   ø€ Ý#Ñ%Ô%Ð%ð:•”˜tÑ$Ô$ð :ð :¨T¬Zð :ð :Ø”kð:ð :Ý-0°©Y¬Yð:ð :ð :ð 	ð Œ;Ô˜vÒ%Ð%Ø˜XÑ%Ð%à˜UŸZšZÐ'QÐ'QÐ'QÐ'Q½eÀDÇIÂIÁKÄKÑ>PÔ>PÐ'QÑ'QÔ'QÑQÔQÑQˆHØ˜d‘? XÑ-Ð-r*   c                ó<   — t          ¦   «          t          | ¦  «        S r"   )r­  r¡   r/   s    r(   r®   zTypedStorage.__repr__^  s   € Ý#Ñ%Ô%Ð%Ý�4‰yŒyÐr*   c                ó”   ‡ — t          ¦   «          t          ˆ fd„t          ‰                      ¦   «         ¦  «        D ¦   «         ¦  «        S )Nc              3  ó(   •K  — | ]}‰|         V — Œd S r"   r#   r¢   s     €r(   r¥   z(TypedStorage.__iter__.<locals>.<genexpr>d  r±   r*   )r­  r²   rª   rC   r/   s   `r(   r³   zTypedStorage.__iter__b  sB   ø€ Ý#Ñ%Ô%Ð%ÝÐ8Ð8Ð8Ð8¥U¨4¯9ª9©;¬;Ñ%7Ô%7Ð8Ñ8Ô8Ñ8Ô8Ð8r*   c                óv   — t          ¦   «          |                      t          j        | j        ¦  «        ¦  «        S r"   )r­  râ  Úcopyr˜  r/   s    r(   r¶   zTypedStorage.__copy__f  s/   € Ý#Ñ%Ô%Ð%Ø×(Ò(­¬°4Ô3HÑ)IÔ)IÑJÔJÐJr*   c                óH   — t          ¦   «          |                      |¦  «        S r"   )r­  Ú	_deepcopy©r%   r¹   s     r(   r»   zTypedStorage.__deepcopy__j  s    € Ý#Ñ%Ô%Ð%Ø�~Š~˜dÑ#Ô#Ð#r*   c                ó\   — |                       t          j        | j        |¦  «        ¦  «        S r"   )râ  r  Údeepcopyr˜  r  s     r(   r  zTypedStorage._deepcopyo  s%   € Ø×(Ò(­¬°tÔ7LÈdÑ)SÔ)SÑTÔTÐTr*   c                óŠ   •— t          ¦   «          t          ¦   «                              ¦   «         |                      ¦   «         z   S r"   )r­  rÊ   rË   rA   rÌ   s    €r(   rË   zTypedStorage.__sizeof__r  s2   ø€ Ý#Ñ%Ô%Ð%Ý‰wŒw×!Ò!Ñ#Ô# d§k¢k¡m¤mÑ3Ð3r*   c                óv   — t          ¦   «          |                      | j                             ¦   «         ¦  «        S )rÏ   )r­  râ  r˜  rµ   r/   s    r(   rµ   zTypedStorage.clonev  s1   € å#Ñ%Ô%Ð%Ø×(Ò(¨Ô)>×)DÒ)DÑ)FÔ)FÑGÔGÐGr*   c                ó<   — t          ¦   «          t          | ¦  «        S rÒ   )r­  rÓ   r/   s    r(   rÔ   zTypedStorage.tolist{  s   € å#Ñ%Ô%Ð%Ý�D‰zŒzÐr*   c                óv   — t          ¦   «          |                      | j                             ¦   «         ¦  «        S )rÖ   )r­  râ  r˜  r×   r/   s    r(   r×   zTypedStorage.cpu€  s1   € å#Ñ%Ô%Ð%Ø×(Ò(¨Ô)>×)BÒ)BÑ)DÔ)DÑEÔEÐEr*   rI   r  c                óR   — t          ¦   «          | j                             |¦  «        S )zèDetermine whether the CPU TypedStorage is already pinned on device.

        Args:
            device (str or torch.device): The device to pin memory on. Default: ``'cuda'``

        Returns:
            A boolean variable.
        )r­  r˜  r!  r"  s     r(   r!  zTypedStorage.is_pinned…  s'   € õ 	$Ñ%Ô%Ð%ØÔ$×.Ò.¨vÑ6Ô6Ð6r*   c                óz   — t          ¦   «          |                      | j                             |¬¦  «        ¦  «        S )zïCopy the CPU TypedStorage to pinned memory, if it's not already pinned.

        Args:
            device (str or torch.device): The device to pin memory on. Default: ``'cuda'``.

        Returns:
            A pinned CPU storage.
        rÐ   )r­  râ  r˜  r$  r"  s     r(   r$  zTypedStorage.pin_memory‘  s?   € õ 	$Ñ%Ô%Ð%Ø×(Ò(ØÔ!×,Ò,°FÐ,Ñ;Ô;ñ
ô 
ð 	
r*   c                óF   — t          ¦   «          |                      ¦   «         S )r(  )r­  Ú_share_memory_r/   s    r(   r/  zTypedStorage.share_memory_Ÿ  s    € å#Ñ%Ô%Ð%Ø×"Ò"Ñ$Ô$Ð$r*   c                ó8   — | j                              ¦   «          | S r"   )r˜  r/  r/   s    r(   r  zTypedStorage._share_memory_¥  s   € ØÔ×+Ò+Ñ-Ô-Ð-Øˆr*   rÐ   c               óÌ   — |€d}t          j        |¦  «        }t           j                             ||                      ¦   «         z  |¬¦  «        }t          || j        d¬¦  «        S )r1  Nr×   rÐ   TrÐ  )rL   r   r   r2  r9  r   rD   )r%   rC   r   r%  s       r(   r2  zTypedStorage._new_shared©  sp   € àˆ>ØˆFÝ”˜fÑ%Ô%ˆÝÔ.×:Ò:Ø�4×%Ò%Ñ'Ô'Ñ'°ð ;ñ 
ô 
ˆõ Ø(°´
Àdð
ñ 
ô 
ð 	
r*   c                ó   — | j         j        S r"   )r˜  r   r/   s    r(   r   zTypedStorage._cdataµ  s   € àÔ$Ô+Ð+r*   c                ó6   — t          ¦   «          | j        j        S r"   )r­  r˜  r   r/   s    r(   r   zTypedStorage.device¹  s   € å#Ñ%Ô%Ð%ØÔ$Ô+Ð+r*   c                óF   — t          ¦   «          |                      ¦   «         S r"   rä  r/   s    r(   rC   zTypedStorage.size¾  rå  r*   c                ó^   — | j                              ¦   «         |                      ¦   «         z  S r"   )r˜  rA   r9  r/   s    r(   rÆ  zTypedStorage._sizeÃ  s*   € ð Ô$×+Ò+Ñ-Ô-°×1CÒ1CÑ1EÔ1EÑEÐEr*   c                óF   — t          ¦   «          |                      ¦   «         S r"   )r­  Ú_pickle_storage_typer/   s    r(   Úpickle_storage_typez TypedStorage.pickle_storage_typeÈ  s    € Ý#Ñ%Ô%Ð%Ø×(Ò(Ñ*Ô*Ð*r*   c                óŒ   — 	 t          ¦   «         | j                 S # t          $ r}t          d| j        › d�¦  «        |‚d }~ww xY w)Nzdtype z is not recognized)rŽ  rD   ÚKeyError)r%   Úes     r(   r&  z!TypedStorage._pickle_storage_typeÍ  s\   € ð	KÝ-Ñ/Ô/°´
Ô;Ð;øÝð 	Kð 	Kð 	KÝÐB D¤JÐBÐBÐBÑCÔCÈÐJøøøøð	Køøøs   ‚ ›
A¥>¾Ac                óŽ   — t          j        ¦   «         }t          j        | |d¬¦  «         t          |                     ¦   «         ffS r½   r¿   rÅ   s     r(   rÇ   zTypedStorage.__reduce__Ó  rÈ   r*   c                óF   — t          ¦   «          |                      ¦   «         S r"   )r­  Ú	_data_ptrr/   s    r(   rX   zTypedStorage.data_ptrØ  s   € Ý#Ñ%Ô%Ð%Ø�~Š~ÑÔÐr*   c                ó4   — | j                              ¦   «         S r"   )r˜  rX   r/   s    r(   r-  zTypedStorage._data_ptrÝ  s   € ØÔ$×-Ò-Ñ/Ô/Ð/r*   c                óP   — t          ¦   «          | j                             ¦   «         S r"   )r­  r˜  rZ   r/   s    r(   rZ   zTypedStorage.resizableà  s#   € Ý#Ñ%Ô%Ð%ØÔ$×.Ò.Ñ0Ô0Ð0r*   c                óL   — t          ¦   «          |                      |¦  «         d S r"   )r­  Ú_resize_rw   s     r(   rx   zTypedStorage.resize_ä  s&   € Ý#Ñ%Ô%Ð%Ø�Š�dÑÔÐÐÐr*   c                ód   — | j                              ||                      ¦   «         z  ¦  «         d S r"   )r˜  rx   r9  rw   s     r(   r1  zTypedStorage._resize_é  s0   € ØÔ×%Ò% d¨T×-?Ò-?Ñ-AÔ-AÑ&AÑBÔBÐBÐBÐBr*   c                ó$   — t          j        |i |¤ŽS r"   )r   rˆ   rh   s      r(   rˆ   zTypedStorage._free_weak_refì  s   € åÔ,¨dÐ=°fÐ=Ð=Ð=r*   c                ó&   —  | j         j        |i |¤ŽS r"   )r˜  rz   r$   s      r(   rz   zTypedStorage._weak_refð  s   € Ø.ˆtÔ$Ô.°Ð?¸Ð?Ð?Ð?r*   c                ó8   — t          ¦   «           | j        |i |¤ŽS r"   )r­  Ú_from_bufferrh   s      r(   ri   zTypedStorage.from_bufferó  s&   € å#Ñ%Ô%Ð%ØˆsÔ Ð0¨Ð0Ð0Ð0r*   rÝ   c               ó¸  — | t           k    rj|€t          j        ¦   «         n|}t          j        |€dn|¦  «        }|j        dk    rt          d|j        › �¦  «        ‚t          j        j        |d|i|¤Ž}nT|€t          |¦  «        dk    rt          d¦  «        ‚|�t          d¦  «        ‚| j	        }t          j        j        |d|i|¤Ž}t          ||d¬¦  «        S )	Nr×   z3TypedStorage.from_buffer: Not available for device rD   é   zefrom_buffer: 'dtype' can only be specified in UntypedStorage.from_buffer and TypedStorage.from_bufferzffrom_buffer: 'device' can only be specified in UntypedStorage.from_buffer and TypedStorage.from_bufferTrÐ  )
r   rL   rÛ  r   rG   rÒ  r   ri   r¨   rÁ  )r_   rD   r   r&   r'   r%  s         r(   r6  zTypedStorage._from_bufferø  s*  € à•,ÒÐØ16°•EÔ+Ñ-Ô-Ð-ÀEˆEÝ”\¨6¨> % %¸vÑFÔFˆFØŒ{˜eÒ#Ð#Ý"ØWÈ&Ì+ÐWÐWñô ð õ 5:Ô4HÔ4TØð5Ø"ð5Ø&,ð5ð 5ˆOˆOð
 Ð ¥C¨¡I¤I°¢N NÝ"ðNñô ð ð Ð!Ý"ðNñô ð ð
 ”JˆEÝ#Ô2Ô>ØðØ"ðØ&,ðð ˆOõ ¨ÀÐQUÐVÑVÔVÐVr*   c                ó¦  — t          |t          j        ¦  «        st          dt	          |¦  «        › �¦  «        ‚t          j        g | j        | j        ¬¦  «                             | ¦  «                             |¦  «         	                    ¦   «         }| 
                    ¦   «         |  
                    ¦   «         k    r|                     ¦   «         }|S rÜ   )rÞ   rL   rD   rß   rG   rà   r   râ   rM   rã   rX   rµ   rä   s      r(   r   zTypedStorage._to  s¥   € Ý˜%¥¤Ñ-Ô-ð 	XÝÐVÍÈeÉÌÐVÐVÑWÔWÐWåŒL˜ 4¤:°d´kÐBÑBÔBßŠT�$‰ZŒZßŠR�‰YŒYßŠ^ÑÔð	 	ð ×ÒÑÔ §¢¡¤Ò0Ð0Ø—m’m‘o”oˆGØˆr*   c                ó\   — t          ¦   «          |                      t          j        ¦  «        S ré   )r­  r   rL   rê   r/   s    r(   rê   zTypedStorage.double%  ó"   € å#Ñ%Ô%Ð%Ø�xŠx�œÑ%Ô%Ð%r*   c                ó\   — t          ¦   «          |                      t          j        ¦  «        S rí   )r­  r   rL   rî   r/   s    r(   rî   zTypedStorage.float*  ó"   € å#Ñ%Ô%Ð%Ø�xŠx�œÑ$Ô$Ð$r*   c                ó\   — t          ¦   «          |                      t          j        ¦  «        S rñ   )r­  r   rL   rò   r/   s    r(   rò   zTypedStorage.half/  ó"   € å#Ñ%Ô%Ð%Ø�xŠx�œ
Ñ#Ô#Ð#r*   c                ó\   — t          ¦   «          |                      t          j        ¦  «        S rõ   )r­  r   rL   rö   r/   s    r(   rö   zTypedStorage.long4  r?  r*   c                ó\   — t          ¦   «          |                      t          j        ¦  «        S rø   )r­  r   rL   rù   r/   s    r(   rù   zTypedStorage.int9  s"   € å#Ñ%Ô%Ð%Ø�xŠx�œ	Ñ"Ô"Ð"r*   c                ó\   — t          ¦   «          |                      t          j        ¦  «        S rû   )r­  r   rL   rü   r/   s    r(   rü   zTypedStorage.short>  r=  r*   c                ó\   — t          ¦   «          |                      t          j        ¦  «        S rþ   )r­  r   rL   rÿ   r/   s    r(   r   zTypedStorage.charC  r?  r*   c                ó\   — t          ¦   «          |                      t          j        ¦  «        S r  )r­  r   rL   rá   r/   s    r(   r  zTypedStorage.byteH  r=  r*   c                ó\   — t          ¦   «          |                      t          j        ¦  «        S r  )r­  r   rL   r  r/   s    r(   r  zTypedStorage.boolM  r?  r*   c                ó\   — t          ¦   «          |                      t          j        ¦  «        S r  )r­  r   rL   r	  r/   s    r(   r	  zTypedStorage.bfloat16R  s"   € å#Ñ%Ô%Ð%Ø�xŠx�œÑ'Ô'Ð'r*   c                ó\   — t          ¦   «          |                      t          j        ¦  «        S r  )r­  r   rL   r  r/   s    r(   r  zTypedStorage.complex_doubleW  s"   € å#Ñ%Ô%Ð%Ø�xŠx�œÑ&Ô&Ð&r*   c                ó\   — t          ¦   «          |                      t          j        ¦  «        S r  )r­  r   rL   r  r/   s    r(   r  zTypedStorage.complex_float\  r;  r*   c                ó\   — t          ¦   «          |                      t          j        ¦  «        S r  )r­  r   rL   r  r/   s    r(   r  zTypedStorage.float8_e5m2a  s#   € å#Ñ%Ô%Ð%Ø�xŠx�Ô)Ñ*Ô*Ð*r*   c                ó\   — t          ¦   «          |                      t          j        ¦  «        S r  )r­  r   rL   r  r/   s    r(   r  zTypedStorage.float8_e4m3fnf  s#   € å#Ñ%Ô%Ð%Ø�xŠx�Ô+Ñ,Ô,Ð,r*   c                ó\   — t          ¦   «          |                      t          j        ¦  «        S r  )r­  r   rL   r  r/   s    r(   r  zTypedStorage.float8_e5m2fnuzk  ó#   € å#Ñ%Ô%Ð%Ø�xŠx�Ô-Ñ.Ô.Ð.r*   c                ó\   — t          ¦   «          |                      t          j        ¦  «        S r  )r­  r   rL   r  r/   s    r(   r  zTypedStorage.float8_e4m3fnuzp  rL  r*   c                óð   — t          ¦   «          | t          k    rt          d¦  «        ‚t                               |||t
          j                             | j        ¦  «        z  ¦  «        } | |¬¦  «        }|S )a²  from_file(filename, shared=False, size=0) -> Storage

        Creates a CPU storage backed by a memory-mapped file.

        If ``shared`` is ``True``, then memory is shared between all processes.
        All changes are written to the file. If ``shared`` is ``False``, then the changes on
        the storage do not affect the file.

        ``size`` is the number of elements in the storage. If ``shared`` is ``False``,
        then the file must contain at least ``size * sizeof(Type)`` bytes
        (``Type`` is the type of storage). If ``shared`` is ``True`` the file will be created if needed.

        Args:
            filename (str): file name to map
            shared (bool): whether to share memory (whether ``MAP_SHARED`` or ``MAP_PRIVATE`` is passed to the
                            underlying `mmap(2) call <https://man7.org/linux/man-pages/man2/mmap.2.html>`_)
            size (int): number of elements in the storage
        z/from_file can only be called on derived classesrá  )	r­  r   rÒ  r   r�   rL   r8  r9  rD   )r_   rŽ   r�   rC   r%  rå   s         r(   r�   zTypedStorage.from_fileu  sv   € õ( 	$Ñ%Ô%Ð%Ø•,ÒÐÝÐPÑQÔQÐQÝ(×2Ò2Ø�f˜d¥U¤\×%?Ò%?ÀÄ	Ñ%JÔ%JÑJñ
ô 
ˆð �# ?Ð3Ñ3Ô3ˆØˆr*   c                ó$   — t          j        |i |¤ŽS r"   )r   r’   rh   s      r(   r’   zTypedStorage._expired’  s   € åÔ&¨Ð7°Ð7Ð7Ð7r*   c                ó&   —  | j         j        |i |¤ŽS r"   )r˜  ru   r$   s      r(   ru   zTypedStorage._write_file–  s   € Ø0ˆtÔ$Ô0°$ÐA¸&ÐAÐAÐAr*   c                ó&   —  | j         j        |i |¤ŽS r"   )r˜  r|   r$   s      r(   r|   zTypedStorage._set_from_file™  ó   € Ø3ˆtÔ$Ô3°TÐD¸VÐDÐDÐDr*   c                ó&   —  | j         j        |i |¤ŽS r"   )r˜  r~   r$   s      r(   r~   zTypedStorage._set_cdataœ  s   € Ø/ˆtÔ$Ô/°Ð@¸Ð@Ð@Ð@r*   c                ó&   —  | j         j        |i |¤ŽS r"   )r˜  r€   r$   s      r(   r€   zTypedStorage._share_cuda_Ÿ  s   € Ø1ˆtÔ$Ô1°4ÐB¸6ÐBÐBÐBr*   c                óF   — t          ¦   «          |                      ¦   «         S r"   )r­  Ú
_is_sharedr/   s    r(   r‚   zTypedStorage.is_shared¢  s   € Ý#Ñ%Ô%Ð%Ø�ŠÑ Ô Ð r*   c                ó4   — | j                              ¦   «         S r"   )r˜  r‚   r/   s    r(   rV  zTypedStorage._is_shared§  s   € ØÔ$×.Ò.Ñ0Ô0Ð0r*   c                ó.   — t          j        j        |i |¤ŽS r"   )rL   r   r„   rh   s      r(   r„   zTypedStorage._new_shared_cudaª  s   € åÔ#Ô4°dÐE¸fÐEÐEÐEr*   c                ób   —  | j         j        |i |¤Ž\  }}}||||                      ¦   «         z  fS r"   )r˜  r\   r9  )r%   r&   r'   Úmanager_handleÚstorage_handlerC   s         r(   r\   z!TypedStorage._share_filename_cpu_®  sH   € ð
 7ˆDÔ!Ô6¸ÐGÀÐGÐGñ		
ØØØà˜~¨t°t×7IÒ7IÑ7KÔ7KÑ/KÐKÐKr*   c                ó8   — | j                              ¦   «          | S r"   )r˜  rs   r/   s    r(   rs   zTypedStorage._shared_decref¶  s   € ØÔ×,Ò,Ñ.Ô.Ð.Øˆr*   c               ó.   — t          j        j        |i |¤ŽS r"   ©rL   r   ro   )r_   r   r&   r'   s       r(   Ú_release_ipc_counterz!TypedStorage._release_ipc_counterº  ó   € åÔ#Ô=¸tÐNÀvÐNÐNÐNr*   c                ó&   —  | j         j        |i |¤ŽS r"   )r˜  r†   r$   s      r(   r†   zTypedStorage._shared_incref¾  rR  r*   c                ó^   —  | j         j        |i |¤Ž\  }}|||                      ¦   «         z  fS r"   )r˜  r^   r9  )r%   r&   r'   ÚfdrC   s        r(   r^   zTypedStorage._share_fd_cpu_Á  s<   € Ø7�4Ô(Ô7¸ÐHÀÐHÐH‰ˆˆDØ�4˜4×-Ò-Ñ/Ô/Ñ/Ð/Ð/r*   c                ór  — | j         t          ¦   «         vrd S t          ¦   «         | j                  }| j        j        dddt          j                             ¦   «         fvrd S | j        j        dk    rt          nt          t          | j        j        ¦  «        }	 t          ||¦  «        S # t          $ r Y d S w xY w)Nr×   rI   rQ   )	rD   rŽ  r   rG   rL   r-  r.  ÚgetattrÚAttributeError)r%   Ústorage_namer·  s      r(   rþ  z&TypedStorage._get_legacy_storage_classÅ  sÈ   € ØŒ:Õ7Ñ9Ô9Ð9Ð9Ø�4å1Ñ3Ô3°D´JÔ?ˆàŒ;ÔØØØÝŒH×2Ò2Ñ4Ô4ð	$
ð 
ð 
ð �4ð ”[Ô%¨Ò.Ð.�EˆEµG½EÀ4Ä;ÔCSÑ4TÔ4Tð 	ð	Ý˜6 <Ñ0Ô0Ð0øÝð 	ð 	ð 	Ø�4�4ð	øøøs   ÂB( Â(
B6Â5B6r@  )r+   r   )Fr"   )r8   r   r9   r÷  r?  )rD   rE   r9   r  r+   rü  )r   r   r9   r  r+   r   r>  rA  rB  )arC  rD  rE  r   rF  r    rH  rÁ  rŽ   rÈ  rÓ  r)   rŠ   rŒ   r4  râ  r0   rë  r7   rÄ  r5   rñ  r=   rA   rú  rG   rI   rQ   rM   rS   r9  rV   r  r®   r³   r¶   r»   r  rË   rµ   rÔ   r×   r!  r$  r/  r  r2  r   r   rC   rÆ  r'  r&  rÇ   rX   r-  rZ   rx   r1  rG  rˆ   rz   ri   r6  r   rê   rî   rò   rö   rù   rü   r   r  r  r	  r  r  r  r  r  r  r�   r’   ru   r|   r~   r€   r‚   rV  r„   r\   rs   r_  r†   r^   rþ  rI  rJ  s   @r(   r   r   œ  s?  ø€ € € € € € Ø€IÐÐÐÑà,0€LÐ0Ð0Ð0Ñ0àÐÐÑàðð ñ „Xðð ð.ð .ð .ñ „Xð.ð
ð ð ð ØØØðZð Zð Zð Zð Zð Zð Zð~ ØØØðYVð YVð YVð YVð YVðv ð;ð ;ñ „Xð;ð ð:ð :ñ „Xð:ð%ð %ð %ð
<ð <ð <ð <ðð ð ð*ð *ð *ð *ð4)ð )ð )ð! ð ! ð ! ðF"ð "ð "ð*2ð *2ð *2ðXð ð ð ð ðð ð ð
.ð .ð .ð
 !%Ø"ðCð Cð Cð Cð Cð"7ð 7ð 7ð 7ð 7ð6ð 6ð 6ð 6ð 6ð BGð 5ð 5ð 5ð 5ð 5ð 5ð"$ð $ð $ð
6ð 6ð 6ð2ð 2ð 2ð 2ð
.ð 
.ð 
.ðð ð ð9ð 9ð 9ðKð Kð Kð$ð $ð $ð
Uð Uð Uð4ð 4ð 4ð 4ð 4ðHð Hð Hð
ð ð ð
Fð Fð Fð

7ð 
7ð 
7ð 
7ð 
7ð
ð 
ð 
ð 
ð 
ð%ð %ð %ðð ð ð +/ð 

ð 

ð 

ð 

ð 

ð ð,ð ,ñ „Xð,ð ð,ð ,ñ „Xð,ðð ð ð
Fð Fð Fð
+ð +ð +ð
Kð Kð Kð3ð 3ð 3ð
 ð  ð  ð
0ð 0ð 0ð1ð 1ð 1ðð ð ð
Cð Cð Cð ð>ð >ñ „[ð>ð@ð @ð @ð ð1ð 1ñ „[ð1ð Ø'+°Dð Wð Wð Wð Wñ „[ðWð>ð ð ð&ð &ð &ð
%ð %ð %ð
$ð $ð $ð
$ð $ð $ð
#ð #ð #ð
%ð %ð %ð
$ð $ð $ð
%ð %ð %ð
$ð $ð $ð
(ð (ð (ð
'ð 'ð 'ð
&ð &ð &ð
+ð +ð +ð
-ð -ð -ð
/ð /ð /ð
/ð /ð /ð
 ðð ñ „[ðð8 ð8ð 8ñ „[ð8ðBð Bð BðEð Eð EðAð Að AðCð Cð Cð!ð !ð !ð
1ð 1ð 1ð ðFð Fñ „[ðFðLð Lð Lðð ð ð Ø04ð Oð Oð Oð Oñ „[ðOðEð Eð Eð0ð 0ð 0ðð ð ð ð ð ð r*   c                  ó    — e Zd ZU ded<   d„ ZdS )Ú_LegacyStorageMetar¿  rD   c                óž   — t          |¦  «        t          k    r4t          | j        ¦  «        }||j        j         k    o| j        |j        k    S dS r?  )rG   r   r½  rD  r   rD   )r_   ÚinstancerØ  s      r(   Ú__instancecheck__z$_LegacyStorageMeta.__instancecheck__æ  sL   € Ý�‰>Œ>�\Ò)Ð)Ý0°´Ñ@Ô@ˆJØ (¤/Ô"6Ò6ð Ø”	˜Xœ^Ò+ðð ˆur*   N)rC  rD  rE  rF  rl  r#   r*   r(   ri  ri  ã  s1   € € € € € € ØÐÐÑðð ð ð ð r*   ri  c                  óP   — e Zd Zed„ ¦   «         Zed„ ¦   «         Zed„ ¦   «         ZdS )rÑ  c                ó’   — t           j                             | | ¦   «                              ¦   «         z  ¦  «        } | |¬¦  «        S )r1  rá  )rL   r   r2  r9  )r_   rC   r%  s      r(   r2  z_LegacyStorage._new_sharedð  sD   € õ  Ô.×:Ò:¸4À#À#Á%Ä%×BUÒBUÑBWÔBWÑ;WÑXÔXˆØˆs Ð0Ñ0Ô0Ð0r*   c                ó.   — t          j        j        |i |¤ŽS r"   r^  rh   s      r(   r_  z#_LegacyStorage._release_ipc_counterö  r`  r*   c                ó¦   — |t           j                             | j        ¦  «        z  } | t           j                             |||¦  «        ¬¦  «        S )Nrá  )rL   r8  r9  rD   r   rm   )r_   rk   rl   rC   Ú
bytes_sizes        r(   Ú_new_shared_filenamez#_LegacyStorage._new_shared_filenameú  sT   € à�EœL×6Ò6°s´yÑAÔAÑAˆ
ØˆsÝÔ-×FÒFØ˜˜jñô ð
ñ 
ô 
ð 	
r*   N)rC  rD  rE  rG  r2  r_  rr  r#   r*   r(   rÑ  rÑ  ï  sf   € € € € € Øð1ð 1ñ „[ð1ð
 ðOð Oñ „[ðOð ð
ð 
ñ „[ð
ð 
ð 
r*   rÑ  )Ú	metaclassr'  c                óx   — 	 t          ¦   «         |          S # t          $ r}t          d| › d�¦  «        |‚d }~ww xY w)Nzpickle storage type "z" is not recognized)r•  r)  )r'  r*  s     r(   Ú#_get_dtype_from_pickle_storage_typeru    s\   € ðÝ)Ñ+Ô+Ð,?Ô@Ð@øÝð ð ð ÝØLÐ$7ÐLÐLÐLñ
ô 
àð	øøøøðøøøs   ‚ –
9 4´9)r6  )r·  r¡   )r'  r¡   )DÚ
__future__r   rÔ  r  rW  rÀ   rN  r±  Útypingr   r   r   Ú_Dictr   Ú	_Optionalr   r	   r
   r   Útyping_extensionsr   rL   Útorch._utilsr   r   Útorch.typesr   r   r   Útorch._prims_commonr   Ú__all__ÚnumpyrŸ  rž  ÚModuleNotFoundErrorÚLockrM  r   rF  r   r   rY  r-  ÚStorageBaser   rÃ   Ú	lru_cacheru  rŽ  r•  rœ  r¢  r¤  r¥  r¨  r­  r¶  r½  r   Ú__doc__rG   rI   rQ   rM   ri  rÑ  ru  r#   r*   r(   ú<module>r…     s*  ðð #Ð "Ð "Ð "Ð "Ð "Ð "à Ð Ð Ð Ø €€€Ø Ð Ð Ð Ø 	€	€	€	Ø Ð Ð Ð Ø €€€ð	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð #Ð "Ð "Ð "Ð "Ð "à €€€Ø #Ð #Ð #Ð #Ð #Ð #Ð #Ð #Ø ,Ð ,Ð ,Ð ,Ð ,Ð ,Ð ,Ð ,Ð ,Ð ,ð ð 3Ø2Ð2Ð2Ð2Ð2Ð2ð Ð+Ð
,€ðØÐÐÐà€I€IøØð ð ð Ø€IØ	€B€B€Bðøøøð
 $�Y”^Ñ%Ô%Ð Ø13Ð Ð 3Ð 3Ð 3Ñ 3à€GˆCÐ:Ð;Ñ;Ô;€ðx"ð x"ð x"ð x"ð x"ñ x"ô x"ð x"ðv!ð !ð !ðH@=ð @=ð @=ð @=ð @=�U”XÔ)¨<ñ @=ô @=ð @=ðF9ð 9ð 9ð €Ô˜TÐ"Ñ"Ô"ðð ñ #Ô"ðð( €Ô˜TÐ"Ñ"Ô"ðð ñ #Ô"ðð6 €Ô˜TÐ"Ñ"Ô"ðð ñ #Ô"ðð
8ð 8ð 8ð2"ð "ð "ð &+Ð "ð.ð .ð .ð5ð 5ð 5ðBð Bð Bð Bð(?ð ?ð ?ðð ð ð ð~ð ~ð ~ð ~ð ~ñ ~ô ~ð ~ðB "œM€Ô Ô Ø(Ô-Ô5€Ô Ô Ø'Ô+Ô3€Ô Ô Øœ+€„Ô ð	ð 	ð 	ð 	ð 	˜ñ 	ô 	ð 	ð
ð 
ð 
ð 
ð 
�\Ð-?ð 
ñ 
ô 
ð 
ð*ð ð ð ð ð s   ÁA$ Á$	A0Á/A0