Ë
    òÍ:j�Ì  ã                  ón  — 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 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 ejB                  «       Z"i Z#de$d<    edd¬«      Z% G d„ d«      Z&d„ Z' G d„ d	ejP                  jR                  e&«      Z*d„ Z+ejX                  d„ «       Z-ejX                  d„ «       Z.ejX                  d„ «       Z/d„ Z0d„ Z1da2d„ Z3d„ Z4d'd„Z5d„ Z6d(d„Z7 G d „ d«      Z8ejr                  e8jt                  _9        e&jv                  jr                  e8jv                  _9        e&jx                  jr                  e8jx                  _9        ejr                  e8jz                  _9         G d!„ d"e:«      Z> G d#„ d$e8e>¬%«      Z?d)d&„Z@y# e $ r dZdZY �ŒTw xY w)*é    )ÚannotationsN)ÚAnyÚcastÚOptionalÚ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                  ó&  ‡ — 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ded<   d„ Zd]d„Z	d„ Z
d„ Zd^d_d„Zd`d„Zd]d„Zd]d„Z	 da	 	 	 	 	 dbd„Z	 da	 d`d„Zdad`d„Zd]d„Zd]d„Zd]d„Zdcd„Zd„ Zd„ Zeddd„«       Zeddd „«       Zeded!„«       Zed	d	d"œ	 ded#„«       Zed	d$œd%„«       Zeded&„«       Zeded'„«       Z d`d(„Z!d)„ Z"dfd*„Z#d`d+„Z$d,„ Z%d-„ Z&d.„ Z'dcd/„Z(eded0„«       Z)d1„ Z*ed2„ «       Z+e,d3„ «       Z-e,d4„ «       Z.ed`d5„«       Z/ed`d6„«       Z0d7„ Z1dgd8„Z2d9„ Z3d:„ Z4d;„ Z5d<„ Z6d=„ Z7ˆ fd>„Z8d?„ Z9d@„ Z:dA„ Z;dB„ Z<dC„ Z=ddDœdhdE„Z>dF„ Z?dG„ Z@dH„ ZAdI„ ZBdJ„ ZCdK„ ZDdL„ ZEdM„ ZFdN„ ZGdO„ ZHdP„ ZIdQ„ ZJdR„ ZKdS„ ZLdT„ ZMdU„ ZNdidjdV„ZOdidjdW„ZPdX„ ZQedYd$œdZ„«       ZRd[„ ZSd\„ ZTˆ xZUS )kÚ_StorageBaser   Ú_cdataFr   Ú	is_sparseÚis_sparse_csrztorch.deviceÚdeviceNú_Optional[torch.device]Ú_fake_devicez_Optional[int]Ú_checkpoint_offsetc                 ó   — y ©N© ©ÚselfÚargsÚkwargss      úb/home/mcse/projects/srt_converter/srt-converter-venv/lib/python3.12/site-packages/torch/storage.pyÚ__init__z_StorageBase.__init__5   s   € Øó    c                ó   — t         ‚r!   ©ÚNotImplementedError©r$   s    r'   Ú__len__z_StorageBase.__len__8   ó   € Ü!Ð!r)   c                ó   — t         ‚r!   r+   ©r$   Úidxs     r'   Ú__getitem__z_StorageBase.__getitem__;   r/   r)   c                ó   — t         ‚r!   r+   r#   s      r'   Ú__setitem__z_StorageBase.__setitem__>   r/   r)   c                ó   — t         ‚r!   r+   ©r$   ÚsourceÚnon_blockings      r'   Úcopy_z_StorageBase.copy_A   r/   r)   c                ó   — t         ‚r!   r+   r-   s    r'   Únewz_StorageBase.newD   r/   r)   c                ó   — t         ‚r!   r+   r-   s    r'   Únbytesz_StorageBase.nbytesG   r/   r)   c                ó"   — | j                  «       S r!   )r>   r-   s    r'   Úsizez_StorageBase.sizeJ   s   € Ø�{‰{‹}Ðr)   c                ó   — t        | ||«      S r!   )r   )r$   Údtyper9   s      r'   Útypez_StorageBase.typeM   s   € ô �T˜5 ,Ó/Ð/r)   c                ó‚   — |rt        j                  d|«      nt        j                  d«      }| j                  ||¬«      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'   rE   z_StorageBase.cudaR   s4   € ñ 39”%—,‘,˜v vÔ.¼e¿l¹lÈ6Ó>RˆØ�w‰w˜g°LˆwÓAÐAr)   c                ó‚   — |rt        j                  d|«      nt        j                  d«      }| j                  ||¬«      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.
        ÚhpurF   rG   rJ   s       r'   rM   z_StorageBase.hpuc   s4   € ñ 28”%—,‘,˜u fÔ-¼U¿\¹\È%Ó=PˆØ�w‰w˜g°LˆwÓAÐAr)   c                ó   — t         ‚r!   r+   r-   s    r'   Úelement_sizez_StorageBase.element_sizer   r/   r)   c                ó.   — | j                   j                  S r!   )r   Úindexr-   s    r'   Ú
get_devicez_StorageBase.get_deviceu   s   € Ø�{‰{× Ñ Ð r)   c                ó   — t         ‚r!   r+   r-   s    r'   Údata_ptrz_StorageBase.data_ptrx   r/   r)   c                ó   — t         ‚r!   r+   r-   s    r'   Ú	resizablez_StorageBase.resizable{   r/   r)   c                ó   — t         ‚r!   r+   r#   s      r'   Ú_share_filename_cpu_z!_StorageBase._share_filename_cpu_   r/   r)   c                ó   — t         ‚r!   r+   r#   s      r'   Ú_share_fd_cpu_z_StorageBase._share_fd_cpu_‚   r/   r)   c                ó   — t         ‚r!   r+   ©Úclsr@   s     r'   Ú_new_using_filename_cpuz$_StorageBase._new_using_filename_cpu…   ó   € ä!Ð!r)   c                ó   — t         ‚r!   r+   r\   s     r'   Ú_new_using_fd_cpuz_StorageBase._new_using_fd_cpu‰   r_   r)   c                ó   — t         ‚r!   r+   ©r]   r%   r&   s      r'   Úfrom_bufferz_StorageBase.from_buffer�   r_   r)   )r   rB   c               ó   — t         ‚r!   r+   )r]   ÚmanagerÚobjr@   r   rB   s         r'   Ú_new_shared_filename_cpuz%_StorageBase._new_shared_filename_cpu‘   s
   € ô "Ð!r)   ©r   c               ó&   —  | j                   |i |¤ŽS r!   )Ú_release_ipc_counter_cuda©r]   r   r%   r&   s       r'   Ú_release_ipc_counterz!_StorageBase._release_ipc_counter�   s   € à,ˆs×,Ñ,¨dÐ=°fÑ=Ð=r)   c                ó   — t         ‚r!   r+   rc   s      r'   rk   z&_StorageBase._release_ipc_counter_cuda¡   r_   r)   c                ó   — t         ‚r!   r+   rc   s      r'   Ú_new_with_weak_ptrz_StorageBase._new_with_weak_ptr¥   r_   r)   c                ó   — t         ‚r!   r+   r-   s    r'   Ú_shared_decrefz_StorageBase._shared_decref©   r/   r)   c                ó   — t         ‚r!   r+   r#   s      r'   Ú_write_filez_StorageBase._write_file¬   r/   r)   c                ó   — t         ‚r!   r+   ©r$   r@   s     r'   Úresize_z_StorageBase.resize_¯   r/   r)   c                ó   — t         ‚r!   r+   r#   s      r'   Ú	_weak_refz_StorageBase._weak_ref²   r/   r)   c                ó   — t         ‚r!   r+   r#   s      r'   Ú_set_from_filez_StorageBase._set_from_fileµ   r/   r)   c                ó   — t         ‚r!   r+   r#   s      r'   Ú
_set_cdataz_StorageBase._set_cdata¸   r/   r)   c                ó   — t         ‚r!   r+   r#   s      r'   Ú_share_cuda_z_StorageBase._share_cuda_»   r/   r)   c                ó   — t         ‚r!   r+   r-   s    r'   Ú	is_sharedz_StorageBase.is_shared¾   r/   r)   c                ó   — t         ‚r!   r+   rc   s      r'   Ú_new_shared_cudaz_StorageBase._new_shared_cudaÁ   r_   r)   c                ó   — t         ‚r!   r+   r#   s      r'   Ú_shared_increfz_StorageBase._shared_increfÅ   r/   r)   c                ó   — t         ‚r!   r+   rc   s      r'   Ú_free_weak_refz_StorageBase._free_weak_refÈ   r_   r)   c                ó   — t         ‚r!   r+   r-   s    r'   Úis_cudaz_StorageBase.is_cudaÌ   r_   r)   c                ó   — t         ‚r!   r+   r-   s    r'   Úis_hpuz_StorageBase.is_hpuÐ   r_   r)   c                ó   — t         ‚r!   r+   )r]   ÚfilenameÚsharedr>   s       r'   Ú	from_filez_StorageBase.from_fileÔ   r_   r)   c                ó   — t         ‚r!   r+   rc   s      r'   Ú_expiredz_StorageBase._expiredØ   r_   r)   c                ó   — t         ‚r!   r+   r#   s      r'   Ú	_byteswapz_StorageBase._byteswapÜ   r/   r)   c                ó   — t         ‚r!   r+   r#   s      r'   Ú_get_filenamez_StorageBase._get_filenameß   r/   r)   c                ó  ‡ — dt        j                  ‰ «      › d‰ j                  › dt        ‰ «      › d�}‰ j                  j                  dk(  rd|z   S ddj                  ˆ fd	„t        ‰ j                  «       «      D «       «      z   }|d
z   |z   S )Nú[z(device=ú
) of size ú]Úmetaú...
ú ú
 c              3  ó:   •K  — | ]  }t        ‰|   «      –— Œ y ­wr!   ©Ústr©Ú.0Úir$   s     €r'   ú	<genexpr>z(_StorageBase.__repr__.<locals>.<genexpr>æ   s   øè ø€ Ò#M°Q¤C¨¨Q©§LÑ#Mùó   ƒú
)rH   Útypenamer   ÚlenrC   ÚjoinÚranger@   ©r$   Úinfo_strÚdata_strs   `  r'   Ú__repr__z_StorageBase.__repr__â   s�   ø€ Ø”u—~‘~ dÓ+Ð,¨H°T·[±[°MÀÌCÐPTËIÈ;ÐVWÐXˆØ�;‰;×Ñ˜vÒ%Ø˜XÑ%Ð%Ø˜Ÿ™Ó#M¼%ÀÇ	Á	ÃÓ:LÔ#MÓMÑMˆØ˜$‰ Ñ)Ð)r)   c                óZ   ‡ — t        ˆ fd„t        ‰ j                  «       «      D «       «      S )Nc              3  ó(   •K  — | ]	  }‰|   –— Œ y ­wr!   r"   r¡   s     €r'   r¤   z(_StorageBase.__iter__.<locals>.<genexpr>ê   ó   øè ø€ Ò8 �D˜•GÑ8ùó   ƒ)Úiterrª   r@   r-   s   `r'   Ú__iter__z_StorageBase.__iter__é   s   ø€ ÜÓ8¤U¨4¯9©9«;Ó%7Ô8Ó8Ð8r)   c                ó"   — | j                  «       S r!   )Úcloner-   s    r'   Ú__copy__z_StorageBase.__copy__ì   s   € Ø�z‰z‹|Ðr)   c                ó¢   — |j                  di «      }| j                  |v r|| j                     S | j                  «       }||| j                  <   |S )NrH   )Ú
setdefaultr   r¶   )r$   ÚmemoÚnew_storages      r'   Ú__deepcopy__z_StorageBase.__deepcopy__ï   sL   € Ø�‰˜w¨Ó+ˆØ�;‰;˜$ÑØ˜Ÿ™Ñ$Ð$Ø—j‘j“lˆØ'ˆˆT�[‰[ÑØÐr)   c                óˆ   — t        j                  «       }t        j                  | |d¬«       t        |j                  «       ffS ©NF)Ú_use_new_zipfile_serialization©ÚioÚBytesIOrH   ÚsaveÚ_load_from_bytesÚgetvalue©r$   Úbs     r'   Ú
__reduce__z_StorageBase.__reduce__÷   ó0   € Ü�J‰J‹LˆÜ�
‰
�4˜¸5ÕAÜ  1§:¡:£< /Ð2Ð2r)   c                óB   •— t         ‰| �  «       | j                  «       z   S r!   )ÚsuperÚ
__sizeof__r@   ©r$   Ú	__class__s    €r'   rÌ   z_StorageBase.__sizeof__ü   s   ø€ Ü‰wÑ!Ó# d§i¡i£kÑ1Ð1r)   c                óv   —  t        | «      | j                  «       | j                  ¬«      j                  | «      S )úReturn a copy of this storage.ri   )rC   r>   r   r:   r-   s    r'   r¶   z_StorageBase.cloneÿ   s*   € àŒt�D‹z˜$Ÿ+™+›-°·±Ô<×BÑBÀ4ÓHÐHr)   c                ó   — t        | «      S ©z6Return a list containing the elements of this storage.)Úlistr-   s    r'   Útolistz_StorageBase.tolist  s   € ä�D‹zÐr)   c                óž   — | j                   j                  dk7  r3t        j                  | j	                  «       «      j                  | d«      S | S )úAReturn a CPU copy of this storage if it's not already on the CPU.ÚcpuF©r   rC   rH   r   r@   r:   r-   s    r'   r×   z_StorageBase.cpu  s=   € à�;‰;×Ñ˜uÒ$Ü×'Ñ'¨¯	©	«Ó4×:Ñ:¸4ÀÓGÐGØˆr)   c                ó¢   — | j                   j                  dk7  r5t        j                  | j	                  «       d¬«      j                  | d«      S | S )zAReturn a MPS copy of this storage if it's not already on the MPS.Úmpsri   FrØ   r-   s    r'   rÚ   z_StorageBase.mps  s?   € à�;‰;×Ñ˜uÒ$Ü×'Ñ'¨¯	©	«¸EÔB×HÑHÈÈuÓUÐUØˆr)   c                óž  — t        |t        j                  «      st        dt	        |«      › �«      ‚t        j
                  g t        j                  | j                  ¬«      j                  t        t        | «      «      j                  |«      j                  «       }|j                  «       | j                  «       k(  r|j                  «       }|S ©Nz*Argument 'dtype' must be torch.dtype, not ©rB   r   )Ú
isinstancerH   rB   Ú	TypeErrorrC   ÚtensorÚuint8r   Úset_r   r   rI   Ú_typed_storagerT   r¶   ©r$   rB   Ústorages      r'   r   z_StorageBase._to  s�   € Ü˜%¤§¡Ô-ÜÐHÌÈeËÈÐVÓWÐWä�L‰L˜¤5§;¡;°t·{±{ÔCß‰T”$”w Ó%Ó&ß‰R�‹Yß‰^Óð	 	ð ×ÑÓ §¡£Ò0Ø—m‘m“oˆGØˆr)   ©r9   c               óz   — t        |t        j                  «      st        j                  |«      }t        | ||«      S r!   )rÞ   rH   r   r   )r$   r   r9   s      r'   rI   z_StorageBase.to   s-   € Ü˜&¤%§,¡,Ô/Ü—\‘\ &Ó)ˆFÜ�4˜ Ó.Ð.r)   c                ó@   — | j                  t        j                  «      S ©z"Casts this storage to double type.)r   rH   Údoubler-   s    r'   rê   z_StorageBase.double%  ó   € à�x‰xœŸ™Ó%Ð%r)   c                ó@   — | j                  t        j                  «      S ©z!Casts this storage to float type.)r   rH   Úfloatr-   s    r'   rî   z_StorageBase.float)  ó   € à�x‰xœŸ™Ó$Ð$r)   c                ó@   — | j                  t        j                  «      S ©z Casts this storage to half type.)r   rH   Úhalfr-   s    r'   rò   z_StorageBase.half-  ó   € à�x‰xœŸ
™
Ó#Ð#r)   c                ó@   — | j                  t        j                  «      S ©z Casts this storage to long type.)r   rH   Úlongr-   s    r'   rö   z_StorageBase.long1  ró   r)   c                ó@   — | j                  t        j                  «      S ©zCasts this storage to int type.)r   rH   Úintr-   s    r'   rù   z_StorageBase.int5  s   € à�x‰xœŸ	™	Ó"Ð"r)   c                ó@   — | j                  t        j                  «      S ©z!Casts this storage to short type.)r   rH   Úshortr-   s    r'   rü   z_StorageBase.short9  rï   r)   c                ó@   — | j                  t        j                  «      S ©z Casts this storage to char type.)r   rH   Úint8r-   s    r'   Úcharz_StorageBase.char=  ró   r)   c                ó@   — | j                  t        j                  «      S ©z Casts this storage to byte type.)r   rH   rá   r-   s    r'   Úbytez_StorageBase.byteA  rï   r)   c                ó@   — | j                  t        j                  «      S ©z Casts this storage to bool type.)r   rH   Úboolr-   s    r'   r  z_StorageBase.boolE  ró   r)   c                ó@   — | j                  t        j                  «      S ©z$Casts this storage to bfloat16 type.)r   rH   Úbfloat16r-   s    r'   r	  z_StorageBase.bfloat16I  s   € à�x‰xœŸ™Ó'Ð'r)   c                ó@   — | j                  t        j                  «      S ©z*Casts this storage to complex double type.)r   rH   Úcdoubler-   s    r'   Úcomplex_doublez_StorageBase.complex_doubleM  s   € à�x‰xœŸ™Ó&Ð&r)   c                ó@   — | j                  t        j                  «      S ©z)Casts this storage to complex float type.)r   rH   Úcfloatr-   s    r'   Úcomplex_floatz_StorageBase.complex_floatQ  rë   r)   c                ó@   — | j                  t        j                  «      S ©z&Casts this storage to float8_e5m2 type)r   rH   Úfloat8_e5m2r-   s    r'   r  z_StorageBase.float8_e5m2U  s   € à�x‰xœ×)Ñ)Ó*Ð*r)   c                ó@   — | j                  t        j                  «      S ©z(Casts this storage to float8_e4m3fn type)r   rH   Úfloat8_e4m3fnr-   s    r'   r  z_StorageBase.float8_e4m3fnY  s   € à�x‰xœ×+Ñ+Ó,Ð,r)   c                ó@   — | j                  t        j                  «      S ©z*Casts this storage to float8_e5m2fnuz type)r   rH   Úfloat8_e5m2fnuzr-   s    r'   r  z_StorageBase.float8_e5m2fnuz]  ó   € à�x‰xœ×-Ñ-Ó.Ð.r)   c                ó@   — | j                  t        j                  «      S ©z*Casts this storage to float8_e4m3fnuz type)r   rH   Úfloat8_e4m3fnuzr-   s    r'   r  z_StorageBase.float8_e4m3fnuza  r  r)   c                óº   — t        j                  g t         j                  | j                  ¬«      j	                  t        t        | «      «      j                  |«      S )a-  Determine whether the CPU storage is already pinned on device.

        Args:
            device (str or torch.device): The device to pin memory on (default: ``'cuda'``).
                This argument is discouraged and subject to deprecated.

        Returns:
            A boolean variable.
        rÝ   )rH   rà   rá   r   râ   r   r   Ú	is_pinned©r$   r   s     r'   r   z_StorageBase.is_pinnede  s<   € ô �L‰L˜¤5§;¡;°t·{±{ÔCß‰T”$”w Ó%Ó&ß‰Y�vÓð	
r)   c                óF  — | j                   j                  dk7  rt        d| j                  «       › d�«      ‚t        j                  g t        j
                  | j                   ¬«      j                  t        t        | «      «      j                  |«      }|j                  «       S )a3  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'``).
                This argument is discouraged and subject to deprecated.

        Returns:
            A pinned CPU storage.
        r×   zcannot pin 'z' only CPU memory can be pinnedrÝ   )r   rC   rß   rH   rà   rá   râ   r   r   Ú
pin_memoryÚuntyped_storage)r$   r   Úpinned_tensors      r'   r#  z_StorageBase.pin_memoryu  s|   € ð �;‰;×Ñ˜uÒ$Ü˜l¨4¯9©9«;¨-Ð7VÐWÓXÐXô �L‰L˜¤5§;¡;°t·{±{ÔCß‰T”$”w Ó%Ó&ß‰Z˜Óð 	ð
 ×,Ñ,Ó.Ð.r)   c                óÜ   — ddl m} | j                  j                  dt        j
                  j                  «       fv r	 | S  |«       dk(  r| j                  «        | S | j                  «        | S )ú.See :meth:`torch.UntypedStorage.share_memory_`r   ©Úget_sharing_strategyrE   Úfile_system)	Útorch.multiprocessingr)  r   rC   rH   Ú_CÚ_get_privateuse1_backend_namerX   rZ   )r$   r)  s     r'   Úshare_memory_z_StorageBase.share_memory_‰  sf   € å>à�;‰;×Ñ ¬¯©×(NÑ(NÓ(PÐQÑQØð
 ˆñ	 "Ó# }Ò4Ø×%Ñ%Ô'ð ˆð ×ÑÔ!Øˆr)   r×   c               óþ   — ddl m} t        j                  |«      }|j                  dt        j
                  j                  «       dfv r
 | ||¬«      S  |«       dk(  r| j                  |«      S | j                  |«      S )ú>Create a new storage in shared memory with the same data type.r   r(  rE   rM   ri   r*  )	r+  r)  rH   r   rC   r,  r-  r^   ra   )r]   r@   r   r)  s       r'   Ú_new_sharedz_StorageBase._new_shared•  so   € õ 	?ä—‘˜fÓ%ˆØ�;‰;˜6¤5§8¡8×#IÑ#IÓ#KÈUÐSÑSÙ�t FÔ+Ð+Ù!Ó# }Ò4Ø×.Ñ.¨tÓ4Ð4à×(Ñ(¨Ó.Ð.r)   c                ó   — | S r!   r"   r-   s    r'   Úuntypedz_StorageBase.untyped¢  s   € Øˆr)   c                ó¬   — t         j                  j                  |«      }|j                  rt	        t        |dz  «      d«      }| j                  |«       y)zSwap bytes in underlying data.é   é   N)rH   Ú_utilsÚ_element_sizeÚ
is_complexÚmaxrù   r“   )r$   rB   Ú	elem_sizes      r'   Úbyteswapz_StorageBase.byteswap¥  s@   € ä—L‘L×.Ñ.¨uÓ5ˆ	à×ÒÜœC 	¨A¡Ó.°Ó2ˆIØ�‰�yÕ!r)   ©Úreturnr   r!   )r8   r   r9   z_Optional[_bool]r>  r   )r>  r   ©NF)rB   ú_Optional[str]r9   r   r>  r   )r>  r   )r@   r   r>  r
   ©r>  r
   )r@   r   ©r>  r@  )r   r   r9   r   ©rE   ©r   zUnion[str, torch.device])VÚ__name__Ú
__module__Ú__qualname__Ú__annotations__r   r   r   r   r(   r.   r3   r5   r:   r<   r>   r@   rC   rE   rM   rO   rR   rT   rV   rX   rZ   Úclassmethodr^   ra   rd   rh   rm   rk   rp   rr   rt   rw   ry   r{   r}   r   r�   rƒ   r…   r‡   Úpropertyr‰   r‹   r�   r‘   r“   r•   r®   r´   r·   r¼   rÈ   rÌ   r¶   rÔ   r×   rÚ   r   rI   rê   rî   rò   rö   rù   rü   r   r  r  r	  r  r  r  r  r  r  r   r#  r.  r1  r3  r<  Ú__classcell__©rÎ   s   @r'   r   r   )   sÒ  ø… ØƒKØ€IˆuÓØ €M�5Ó ØÓð -1€LÐ)Ó0à)-Ð˜Ó-òó"ò"ò"ô"ó"ó"óð CHð0Ø#ð0Ø:?ð0à	*ó0ð ).ðBà	*óBô"Bó"ó!ó"ó"ò"ò"ð ò"ó ð"ð ò"ó ð"ð ò"ó ð"ð ð Øñ	"ð 
ò	"ó ð	"ð Ø04ó >ó ð>ð ò"ó ð"ð ò"ó ð"ó"ò"ó"ó"ò"ò"ò"ó"ð ò"ó ð"ò"ð ñ"ó ð"ð ñ"ó ð"ð ñ"ó ð"ð ò"ó ð"ð ò"ó ð"ò"ó"ò*ò9òòò3ô
2òIòòòòð CHõ /ò
&ò%ò$ò$ò#ò%ò$ò%ò$ò(ò'ò&ò+ò-ò/ò/ô
ô /ò(
ð Ø).ó 
/ó ð
/òö"r)   r   c                óB   ‡ — t        j                  ‰ «      ˆ fd„«       }|S )Nc                ór  •— d }d }t         5  | j                  }|t        v r
t        |   }n4t        j                  «       t        |<   t        |   j                  «        |}d d d «       |�|5  	 d d d «       	  ‰| g|¢­i |¤Ž|�?| j                  |k(  sJ ‚t         5  t        |   j                  «        t        |= d d d «       S S # 1 sw Y   ŒexY w# 1 sw Y   ŒcxY w# 1 sw Y   S xY w# |�K| j                  |k(  sJ ‚t         5  t        |   j                  «        t        |= d d d «       w # 1 sw Y   w x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¯  sM  ø€ àˆØˆÜñ 	Ø—+‘+ˆCØÔ'Ñ'Ü+¨CÑ0‘ä)2¯©Ó):Ô! #Ñ&Ü! #Ñ&×.Ñ.Ô0Ø�÷	ð ÐØñ Ø÷ð	3Ù�dÐ,˜TÒ, VÑ,ð Ð"ð —{‘{ gÒ-Ð-Ð-Ü'ñ 3Ü% gÑ.×6Ñ6Ô8Ü)¨'Ð2÷3ð 3ð	 #÷)	ð 	ú÷ð ú÷3ð 3ûð	 Ð"ð —{‘{ gÒ-Ð-Ð-Ü'ñ 3Ü% gÑ.×6Ñ6Ô8Ü)¨'Ð2÷3÷ 3ñ 3úð	 #úsH   ŒACÁ+CÁ6C' ÂCÃCÃCÃC$	Ã'D6ÄD)Ä 	D6Ä)D2Ä.D6)Ú	functoolsÚwraps)rW  rX  s   ` r'   Ú_share_memory_lock_protectedr[  ®  s%   ø€ Ü‡_�_�RÓó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                ój   •— | j                   j                  dk(  rt        d«      ‚t        ‰| �  |i |¤ŽS )Nrš   ú$Not available for 'meta' device type)r   rC   r,   rË   r3   ©r$   r%   r&   rÎ   s      €r'   r3   zUntypedStorage.__getitem__Ó  s6   ø€ Ø�;‰;×Ñ˜vÒ%Ü%Ð&LÓMÐMÜ‰wÑ" DÐ3¨FÑ3Ð3r)   c                ó4   — | j                   j                  dk(  S ©NrE   ©r   rC   r-   s    r'   r‰   zUntypedStorage.is_cudaØ  s   € à�{‰{×Ñ 6Ñ)Ð)r)   c                ó4   — | j                   j                  dk(  S ©NrM   rb  r-   s    r'   r‹   zUntypedStorage.is_hpuÜ  s   € à�{‰{×Ñ 5Ñ(Ð(r)   c                ó"   — | j                  «       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                ó"   •— t        ‰| �  |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 ‰wÑ$ dÐ5¨fÑ5Ð5r)   c                ó"   •— t        ‰| �  |i |¤ŽS r!   )rË   rZ   r_  s      €r'   rZ   zUntypedStorage._share_fd_cpu_  s   ø€ ä‰wÑ% tÐ6¨vÑ6Ð6r)   c                ó"   •— t        ‰| �  |i |¤ŽS r!   )rË   rX   r_  s      €r'   rX   z#UntypedStorage._share_filename_cpu_  s   ø€ ä‰wÑ+¨TÐ<°VÑ<Ð<r)   rB  )rE  rF  rG  r3   rJ  r‰   r‹   r�   r[  r.  rZ   rX   rK  rL  s   @r'   r   r   Ò  s�   ø„ ô4ð
 ñ*ó ð*ð ñ)ó ð)ð ò$ó ð$ð "ó 6ó "ð 6ðD "ó7ó "ð7ð "ó=ó "ô=r)   c                óV   — t        j                  t        j                  | «      d¬«      S )NF)Úweights_only)rH   ÚloadrÁ   rÂ   )rÇ   s    r'   rÄ   rÄ     s   € Ü�:‰:”b—j‘j “m°%Ô8Ð8r)   c                 óÈ  — 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                  t         j                  t         j                  hS r!   )rH   r  r  r  r  Úfloat8_e8m0fnuÚfloat4_e2m1fn_x2Úbits8Úbits16Úbits1x8Úbits2x4Úbits4x2Ú	complex32Úuint16Úuint32Úuint64r"   r)   r'   Ú_new_dtypesrx    sƒ   € ô
 	×ÑÜ×ÑÜ×ÑÜ×ÑÜ×ÑÜ×ÑÜ�‰Ü�‰Ü�‰Ü�‰Ü�‰Ü�‰Ü�‰Ü�‰Ü�‰ðð r)   c                 óH  — 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)rH   rê   rî   rò   rö   rù   Úint16rÿ   rá   r  r	  r  r  Úqint8Úqint32Úquint8Úquint4x2Úquint2x4r"   r)   r'   Ú_dtype_to_storage_type_mapr‘  0  s  € ðÜ�‰�oðä�‰�^ðô 	�
‰
�Mðô 	�
‰
�Mð	ô
 	�	‰	�<ðô 	�‰�^ðô 	�
‰
�Mðô 	�‰�]ðô 	�
‰
�Mðô 	�‰Ð)ðô 	�‰Ð-ðô 	�‰Ð+ðô 	�‰�^ðô 	�‰�oðô 	�‰�oðô  	�‰Ð)ð!ô" 	�‰Ð)ð#ð r)   c                 óh   — t        «       j                  «       D � �ci c]  \  } }|| “Œ
 }} }|S c c}} w r!   )r‘  Úitems)rV  ÚvalÚ	dtype_maps      r'   Ú_storage_type_to_dtype_mapr–  L  s5   € ä*DÓ*F×*LÑ*LÓ*N×O™h˜c 3��c‘ÐO€IÑOØÐùó Ps   œ.c           
     ól  — |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                  «       j                  S )NrÝ   )rH   rŽ  r�  r�  r�  rŒ  rá   Úint32rÿ   rà   rã   Ú_untyped_storage)ÚsequencerB   r   Úinterpret_dtypesÚ
tmp_tensors        r'   Ú_get_storage_from_sequencer�  R  sÃ   € ØÜ�‰Ü�‰Ü�‰Ü�‰Ü�‰ðñ ô �L‰Lœ%Ÿ+™+Ü�N‰NœEŸK™KÜ�N‰NœEŸK™KÜ�L‰Lœ%Ÿ+™+Ü�K‰KœŸ™ð
Ðô —\‘\ØÐ,¨UÑ3¸Fô
‰
ô
 —\‘\ (°%ÀÔGˆ
à×$Ñ$Ó&×7Ñ7Ð7r)   c                ón   — t         r t        | t        t        j                  f«      S t        | t        «      S r!   )Ú	HAS_NUMPYrÞ   rù   ÚnpÚinteger)Úxs    r'   Ú_isintr£  k  s(   € ÝÜ˜!œc¤2§:¡:Ð.Ó/Ð/ä˜!œSÓ!Ð!r)   c                 ó   — t         S r!   )Ú"_always_warn_typed_storage_removalr"   r)   r'   Ú&_get_always_warn_typed_storage_removalr¦  u  s   € Ü-Ð-r)   c                ó,   — t        | t        «      sJ ‚| ay r!   )rÞ   r  r¥  )Úalways_warns    r'   Ú&_set_always_warn_typed_storage_removalr©  y  s   € ä�k¤4Ô(Ð(Ð(Ø)4Ñ&r)   c                ó–   — d„ }t        «       s |«       r5d}t        j                  |t        | dz   ¬«       dt        j
                  d<   y y )Nc                 óL   — t        t        d«      sy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Øä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()r6  )Ú
stacklevelTr¬  )r¦  ÚwarningsÚwarnÚUserWarningr®  r¯  )r±  r°  Úmessages      r'   r®  r®    sL   € òJô .Ô/±=´?ðQð 	ô 	�‰�gœ{°zÀA±~ÕFØ=AÔ#×,Ñ,¨\Ò:ð 4Cr)   c                 ó*   — dt         j                  d<   y )NFr¬  )r®  r¯  r"   r)   r'   Ú!_reset_warn_typed_storage_removalr·  “  s   € Ø9>Ô×(Ñ(¨Ò6r)   c                óx   — | j                  dd«      d   }|dt        j                  j                  «       dfv r|S y)Nú.r6  éÿÿÿÿrE   rM   r×   )ÚrsplitrH   r,  r-  )ÚmoduleÚ	last_parts     r'   Ú_get_device_from_moduler¾  —  s<   € Ø—‘˜c 1Ó% bÑ)€IØ�VœUŸX™X×CÑCÓEÀuÐMÑMØÐàr)   c                  ó8  ‡ — e Zd ZU dZded<   dZded<   ded<   ed	„ «       Zedfd
„«       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dgd„Zd„ Zdhd„Zd„ Zd„ Zd„ Zd„ Zdidjd„Zd„ Zd„ Z	 	 dk	 	 	 	 	 dld„Zdkdgd„Zdkdgd„Zdd œdmd!„Zd"„ Zd#„ Zdnd$„Zd%„ Z d&„ Z!d'„ Z"d(„ Z#d)„ Z$d*„ Z%ˆ fd+„Z&d,„ Z'd-„ Z(d.„ Z)dodpd/„Z*dodpd0„Z+d1„ Z,d2„ Z-dd3œd4„Z.ed5„ «       Z/ed6„ «       Z0d7„ Z1d8„ Z2d9„ Z3d:„ Z4d;„ Z5d<„ Z6d=„ Z7d>„ Z8d?„ Z9d@„ Z:e;dA„ «       Z<dB„ Z=e;dC„ «       Z>e;dddDœdE„«       Z?dF„ Z@dG„ ZAdH„ ZBdI„ ZCdJ„ ZDdK„ ZEdL„ ZFdM„ ZGdN„ ZHdO„ ZIdP„ ZJdQ„ ZKdR„ ZLdS„ ZMdT„ ZNdU„ ZOdV„ ZPe;dW„ «       ZQe;dX„ «       ZRdY„ ZSdZ„ ZTd[„ ZUd\„ ZVd]„ ZWd^„ ZXe;d_„ «       ZYd`„ ZZda„ Z[e;dd3œdb„«       Z\dc„ Z]dd„ Z^de„ Z_ˆ xZ`S )qr   Fr   r   Nr   r   útorch.dtyperB   c                ó   — | j                   S r!   )rB   r-   s    r'   Ú_dtypezTypedStorage._dtype¦  s   € à�z‰zÐr)   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                ón   — t        «        | j                  t        d| j                  «       «      |«       | S )Nr   )r®  Ú_setitemÚsliceÚ_size)r$   Úvalues     r'   Úfill_zTypedStorage.fill_°  s(   € Ü#Ô%Ø�‰”e˜A˜tŸz™z›|Ó,¨eÔ4Øˆr)   )Úwrap_storagerB   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kD  rt	        |dz   «      ‚t        |«      dk(  rRt        |d   «      sDt        |d   t        j                  j                  «      st        |dt        |d   «      › �z   «      ‚t        || j                   t#        | j$                  «      d	d
œŽS t        |«      dk7  rt	        |dz   «      ‚t        |t        j&                  «      st        |dt        |«      › �z   «      ‚t#        | j$                  «      }|j(                  j                  |k7  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 specifiedr6  ú
Too many positional argumentsr   ú
Argument type not recognized: T)rB   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Ê  rB   rË  )r®  rH   rå   Ú_LegacyStorageÚRuntimeErrorr   rË   Ú__new__r¨   r£  rÞ   ÚcollectionsÚabcÚSequencerß   rC   rÂ  r¾  rF  r   r   rB   )	r]   rÊ  rB   r   rË  r%   Úarg_error_msgÚ
cls_devicerÎ   s	           €r'   rÔ  zTypedStorage.__new__µ  s  ø€ ñ Ü'Ô)à”%—-‘-×.Ñ.Ò.ÜØJóð ð ”,ÒÜ‘7‘? 3Ó'Ð'ð �%ð 6ð 6ð ð Ð!Ü"Ø!Ð$UÑUóð ð Ð Ü"Ø!Ð$TÑTóð ð Ð#Ü�t“9˜q’=Ü&Ø%Ð(IÑIóð ô
 ˜“I ’NÜ" 4¨¡7œOÜ& t¨A¡w´·±×0HÑ0HÔIä#Ø%Ø<¼TÀ$ÀqÁ'»]¸OÐLñMóð ô
 $ØØŸ*™*Ü2°3·>±>ÓBØ"ò	ð ô �t“9 ’>Ü&Ø%ð)ñ)óð ô " ,´×0DÑ0DÔEÜ#Ø%ØVÔW[Ð\hÓWiÐVjÐkñlóð ô
 5°S·^±^ÓD�
à×&Ñ&×+Ñ+¨zÒ9Ü&Ø%Ø?À
¸|Ø$ \×%8Ñ%8×%=Ñ%=Ð$>ð@ñ@óð ô $ØØ!-ØŸ)™)Ø"ò	ð r)   )r   rB   rÊ  rË  c               ó¾  — |s
t        «        d}|�³t        |«      dk7  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   «      ‚|| _	        y |€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                  |¬«      | _	        y t        |«      dk(  r¬t#        |d   «      r:t	        j                  t%        |d   «      | j'                  «       z  |¬«      | _	        y t        |d   t(        j*                  j,                  «      r t/        |d   | j
                  |«      | _	        y 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×   rE   ú/Cannot create CUDA storage with quantized dtyperi   r6  rÎ  rÍ  )r®  r¨   rÓ  rÞ   rH   rB   rß   rC   r   r™  Úget_default_dtyper   rŽ  r�  r�  r�  rŒ  r£  rù   r8  rÕ  rÖ  r×  r�  )r$   r   rB   rÊ  rË  r%   rØ  s          r'   r(   zTypedStorage.__init__  sW  € ñ Ü'Ô)ðEð 	ð Ð#Ü�4‹y˜AŠ~Ü"Ø!ð%ñ%óð ð ˆ}Ü"Ø!Ð$JÑJóð ô ˜e¤U§[¡[Ô1ÜØ!ØDÄTÈ%Ã[ÀMÐRñSóð ð
 Ð!Ü"Ø!Ø`ñaóð ð
 ˆDŒJä˜l¬E×,@Ñ,@ÔAÜØ!ØRÔSWÐXdÓSeÐRfÐgñhóð ð
 %1ˆDÕ!ð 7<°mœ×0Ñ0Ô2ÈˆDŒJÜ—\‘\¨6¨>¡%¸vÓFˆFà�z‰zÜ—‘Ü—‘Ü—‘Ü—‘Ü—‘ðñ ð —;‘; &Ò(Ü&ØIóð ô �4‹y˜AŠ~Ü(-×(<Ñ(<ÀFÔ(K�Õ%ä�T“˜a’Ü˜$˜q™'”?Ü,1×,@Ñ,@Ü˜D ™G› t×'9Ñ'9Ó';Ñ;ÀFô-�DÕ)ô    Q¡¬¯©×)AÑ)AÔBÜ,FØ˜Q™ §¡¨Vó-�DÕ)ô $Ø%Ø<¼TÀ$ÀqÁ'»]¸OÐLñMóð ô # =Ð3TÑ#TÓUÐUr)   c                ó\   — t        «        | j                  j                  j                  dk(  S ra  ©r®  r™  r   rC   r-   s    r'   r‰   zTypedStorage.is_cudal  s%   € ä#Ô%Ø×$Ñ$×+Ñ+×0Ñ0°FÑ:Ð:r)   c                ó\   — t        «        | j                  j                  j                  dk(  S rd  rÞ  r-   s    r'   r‹   zTypedStorage.is_hpuq  s%   € ä#Ô%Ø×$Ñ$×+Ñ+×0Ñ0°EÑ9Ð9r)   c                ó.   — t        «        | j                  S )z2Return the internal :class:`torch.UntypedStorage`.)r®  r™  r-   s    r'   r3  zTypedStorage.untypedv  s   € ä#Ô%Ø×$Ñ$Ð$r)   c                óÒ   — t        |«      t        j                  k(  sJ ‚t        | «      t        k(  r&t	        t
        t        || j                  d¬«      «      S  t        | «      |¬«      S )NTrÑ  ©rÊ  )rC   rH   r   r   r   r
   rB   )r$   r$  s     r'   Ú_new_wrapped_storagez!TypedStorage._new_wrapped_storage{  s]   € Ü�OÓ$¬×(<Ñ(<Ò<Ð<Ð<ä�‹:œÒ%ÜÜÜØ!0¸¿
¹
Èdôóð ð ”4˜“:¨?Ô;Ð;r)   c                ó6   — t        «        | j                  «       S r!   ©r®  rÇ  r-   s    r'   r.   zTypedStorage.__len__ˆ  ó   € Ü#Ô%Ø�z‰z‹|Ðr)   c                ó  — |€|r| j                  «       S yt        |«      t        k7  r#t        dt        | «      › dt        |«      › �«      ‚|r`|| j                  «       kD  s|| j                  «        k  rt	        d|› d| j                  «       › �«      ‚|dkD  r|S || j                  «       z  S || j                  «       k\  s|| j                  «        k  rt	        d|› d| j                  «       › �«      ‚|| j                  «       z  S )Nr   úcan't index a ú with zindex z" out of range for storage of size )rÇ  rC   rù   rß   Ú
IndexErrorr@   )r$   r2   Úis_stops      r'   Ú_maybe_wrap_indexzTypedStorage._maybe_wrap_indexŒ  sþ   € Øˆ;ÙØ—z‘z“|Ð#àô �C‹yœCÒÜ .´°d³°¸FÄ4ÈÃ9À+Ð NÓOÐOÙØ˜$Ÿ*™*›,Ò&¨C°4·:±:³<°-Ò,?Ü$Ø   Ð%GÈÏ	É	ËÀ}ÐUóð ð ˜’7Ø�Jà §¡£Ñ-Ð-à˜4Ÿ:™:›<Ò'¨S°D·J±J³L°=Ò-@Ü$Ø   Ð%GÈÏ	É	ËÀ}ÐUóð ð ˜TŸZ™Z›\Ñ)Ð)r)   c                ó:   — t        «        | j                  ||«      S r!   )r®  rÅ  )r$   r2   rÈ  s      r'   r5   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$                  ¬«      }|j'                  t)        | j"                  |d¬«      «       nEt        j                   g | j                  | j"                  j$                  ¬«      j'                  | «      }|||<   y )Nrè  ré  z cannot set item with value type rÝ   TrÑ  )rÞ   rù   rÆ  rÓ  rC   rH   Ú
is_storagerB   rŽ  r�  r�  r�  rŒ  rá   r˜  rÿ   rà   r™  r   râ   r   )r$   r2   rÈ  r›  Ú	tmp_dtyperœ  s         r'   rÅ  zTypedStorage._setitemª  sg  € Ü˜#¤¤U˜|Ô,Ü ´°T³
¨|¸6Ä$ÀsÃ)ÀÐMÓNÐNÜ×Ñ˜EÔ"ÜÐ!AÄ$ÀuÃ+ÀÐOÓPÐPØ�:‰:Ü�L‰LÜ�N‰NÜ�N‰NÜ�L‰LÜ�K‰Kð
ñ 
ô —‘œeŸk™kÜ—‘¤§¡Ü—‘¤§¡Ü—‘œeŸk™kÜ—‘œUŸZ™Zð Ðð )¨¯©Ñ4ˆIÜŸ™Ø˜)¨D×,AÑ,A×,HÑ,HôˆJð �O‰OÜØ!%×!6Ñ!6¸iÐSWôõô Ÿ™Ø˜$Ÿ*™*¨T×-BÑ-B×-IÑ-Iôç‰d�4‹jð ð  ˆ
�3Šr)   c                ó8   — t        «        | j                  |«      S r!   )r®  Ú_getitemr1   s     r'   r3   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¬«      j'                  |«      S | j)                  |«      }dd	lm}  |«       5  t        j.                  g | j                  | j                   j                  ¬
«      j1                  | «      }||   j3                  «       cd d d «       S # 1 sw Y   y xY w)Nrš   r^  z7slices are only supported in UntypedStorage.__getitem__rè  ré  TrÑ  r   )Úunset_fake_temporarilyrÝ   )r™  r   rC   r,   rÞ   rÆ  rÓ  rù   rB   rH   rŽ  r�  r�  r�  rŒ  rá   r˜  rÿ   r   rò  rì  Útorch._subclasses.fake_tensorrô  rà   râ   Úitem)r$   r2   r›  Úidx_wrappedrô  rœ  s         r'   rò  zTypedStorage._getitemÑ  s•  € Ø× Ñ ×'Ñ'×,Ñ,°Ò6Ü%Ð&LÓMÐMô �cœ5Ô!ÜØIóð ô ˜C¤Ô%Ü ´°T³
¨|¸6Ä$ÀsÃ)ÀÐMÓNÐNà�:‰:Ü�L‰LÜ�N‰NÜ�N‰NÜ�L‰LÜ�K‰Kð
ñ 
ô —‘œeŸk™kÜ—‘¤§¡Ü—‘¤§¡Ü—‘œeŸk™kÜ—‘œUŸZ™Zð Ðô  Ø!×2Ñ2Ø& t§z¡zÑ2Øô÷ ‰h�s‹mð	ð ×,Ñ,¨SÓ1ˆÝHá#Ó%ñ 	2ÜŸ™Ø˜$Ÿ*™*¨T×-BÑ-B×-IÑ-Iôç‰d�4‹jð ð ˜kÑ*×/Ñ/Ó1÷		2÷ 	2ò 	2ús   Ç AH"È"H+c                óÂ   — t        «        t        |t        «      r(| j                  j	                  |j                  |«       | S | j                  j	                  ||«       | S r!   )r®  rÞ   r   r™  r:   r7   s      r'   r:   zTypedStorage.copy_ý  sR   € Ü#Ô%Ü�fœlÔ+Ø×!Ñ!×'Ñ'¨×(?Ñ(?ÀÔNð ˆð ×!Ñ!×'Ñ'¨°Ô=Øˆr)   c                ó6   — t        «        | j                  «       S r!   )r®  Ú_nbytesr-   s    r'   r>   zTypedStorage.nbytes  s   € Ü#Ô%Ø�|‰|‹~Ðr)   c                ó6   — | j                   j                  «       S r!   )r™  r>   r-   s    r'   rú  zTypedStorage._nbytes
  s   € Ø×$Ñ$×+Ñ+Ó-Ð-r)   c                ó  — t        «        |€^| j                  «       }|�|j                  dz   |j                  z   S dj	                  | j                  t        | «      j                  g«      S | j                  j                  ||«      S )Nr¹  )r®  Ú_get_legacy_storage_classrF  rE  r©   rC   r™  )r$   rB   r9   Úlegacy_classs       r'   rC   zTypedStorage.type  s|   € ô
 	$Ô%Øˆ=Ø×9Ñ9Ó;ˆLàÐ'Ø#×.Ñ.°Ñ4°|×7LÑ7LÑLÐLà—8‘8˜TŸ_™_¬d°4«j×.AÑ.AÐBÓCÐCð ×(Ñ(×-Ñ-¨e°\ÓBÐBr)   c                ó8  — t        «        | j                  t        j                  t        j                  t        j
                  t        j                  t        j                  fv rt        d«      ‚| j                  j                  ||«      }| j                  |«      S )NrÛ  )r®  rB   rH   rŽ  r�  r�  r�  rŒ  rÓ  r™  rE   rã  )r$   r   r9   Úcuda_storages       r'   rE   zTypedStorage.cuda  ss   € Ü#Ô%Ø�:‰:Ü�L‰LÜ�N‰NÜ�N‰NÜ�L‰LÜ�K‰Kð
ñ 
ô ÐPÓQÐQØ×,Ñ,×1Ñ1°&¸,ÓGˆØ×(Ñ(¨Ó6Ð6r)   c                ó8  — t        «        | j                  t        j                  t        j                  t        j
                  t        j                  t        j                  fv rt        d«      ‚| j                  j                  ||«      }| j                  |«      S )Nz.Cannot create HPU storage with quantized dtype)r®  rB   rH   rŽ  r�  r�  r�  rŒ  rÓ  r™  rM   rã  )r$   r   r9   Úhpu_storages       r'   rM   zTypedStorage.hpu+  ss   € Ü#Ô%Ø�:‰:Ü�L‰LÜ�N‰NÜ�N‰NÜ�L‰LÜ�K‰Kð
ñ 
ô ÐOÓPÐPØ×+Ñ+×/Ñ/°¸ÓEˆØ×(Ñ(¨Ó5Ð5r)   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                  j                  «       › d�«      ‚| j                  j                  ||¬«      }| j                  |«      S )NzCannot create z storage with quantized dtyperF   )r®  rÞ   rH   r   rB   rŽ  r�  r�  r�  rŒ  rÓ  rC   Úupperr™  rI   rã  )r$   r   r9   Ú
to_storages       r'   rI   zTypedStorage.to8  s°   € Ü#Ô%Ü˜&¤%§,¡,Ô/Ü—\‘\ &Ó)ˆFØ�:‰:Ü�L‰LÜ�N‰NÜ�N‰NÜ�L‰LÜ�K‰Kð
ñ 
ô Ø  §¡×!2Ñ!2Ó!4Ð 5Ð5RÐSóð ð ×*Ñ*×-Ñ-°VÈ,Ð-ÓWˆ
Ø×(Ñ(¨Ó4Ð4r)   c                ó6   — t        «        | j                  «       S r!   )r®  r8  r-   s    r'   rO   zTypedStorage.element_sizeI  s   € Ü#Ô%Ø×!Ñ!Ó#Ð#r)   c                óT   — t         j                  j                  | j                  «      S r!   )rH   r7  r8  rB   r-   s    r'   r8  zTypedStorage._element_sizeN  s   € Ü�|‰|×)Ñ)¨$¯*©*Ó5Ð5r)   c                óJ   — t        «        | j                  j                  «       S r!   )r®  r™  rR   r-   s    r'   rR   zTypedStorage.get_deviceQ  s   € Ü#Ô%Ø×$Ñ$×/Ñ/Ó1Ð1r)   c           
     óJ  ‡ — t        «        dt        j                  ‰ «      › d‰ j                  › d‰ j                  › dt        ‰ «      › d�	}‰ j                  j                  dk(  rd|z   S dd	j                  ˆ fd
„t        ‰ j                  «       «      D «       «      z   }|dz   |z   S )Nr—   z(dtype=z	, device=r˜   r™   rš   r›   rœ   r�   c              3  ó:   •K  — | ]  }t        ‰|   «      –— Œ y ­wr!   rŸ   r¡   s     €r'   r¤   z'TypedStorage.__str__.<locals>.<genexpr>^  s   øè ø€ Ò'Q¸¬¨D°©G¯Ñ'Qùr¥   r¦   )
r®  rH   r§   rB   r   r¨   rC   r©   rª   r@   r«   s   `  r'   Ú__str__zTypedStorage.__str__U  sš   ø€ Ü#Ô%à”—‘˜tÓ$Ð% W¨T¯Z©Z¨Lð 9Ø—k‘k�] *¬S°«Y¨K°qð:ð 	ð �;‰;×Ñ˜vÒ%Ø˜XÑ%Ð%à˜UŸZ™ZÓ'Q¼eÀDÇIÁIÃKÓ>PÔ'QÓQÑQˆHØ˜d‘? XÑ-Ð-r)   c                ó,   — t        «        t        | «      S r!   )r®  r    r-   s    r'   r®   zTypedStorage.__repr__a  s   € Ü#Ô%Ü�4‹yÐr)   c                ón   ‡ — t        «        t        ˆ fd„t        ‰ j                  «       «      D «       «      S )Nc              3  ó(   •K  — | ]	  }‰|   –— Œ y ­wr!   r"   r¡   s     €r'   r¤   z(TypedStorage.__iter__.<locals>.<genexpr>g  r±   r²   )r®  r³   rª   r@   r-   s   `r'   r´   zTypedStorage.__iter__e  s%   ø€ Ü#Ô%ÜÓ8¤U¨4¯9©9«;Ó%7Ô8Ó8Ð8r)   c                ór   — t        «        | j                  t        j                  | j                  «      «      S r!   )r®  rã  Úcopyr™  r-   s    r'   r·   zTypedStorage.__copy__i  s(   € Ü#Ô%Ø×(Ñ(¬¯©°4×3HÑ3HÓ)IÓJÐJr)   c                ó8   — t        «        | j                  |«      S r!   )r®  Ú	_deepcopy©r$   rº   s     r'   r¼   zTypedStorage.__deepcopy__m  s   € Ü#Ô%Ø�~‰~˜dÓ#Ð#r)   c                ó`   — | j                  t        j                  | j                  |«      «      S r!   )rã  r  Údeepcopyr™  r  s     r'   r  zTypedStorage._deepcopyr  s$   € Ø×(Ñ(¬¯©°t×7LÑ7LÈdÓ)SÓTÐTr)   c                óV   •— t        «        t        ‰| �	  «       | j                  «       z   S r!   )r®  rË   rÌ   r>   rÍ   s    €r'   rÌ   zTypedStorage.__sizeof__u  s"   ø€ Ü#Ô%Ü‰wÑ!Ó# d§k¡k£mÑ3Ð3r)   c                óh   — t        «        | j                  | j                  j                  «       «      S )rÐ   )r®  rã  r™  r¶   r-   s    r'   r¶   zTypedStorage.cloney  s(   € ä#Ô%Ø×(Ñ(¨×)>Ñ)>×)DÑ)DÓ)FÓGÐGr)   c                ó,   — t        «        t        | «      S rÒ   )r®  rÓ   r-   s    r'   rÔ   zTypedStorage.tolist~  s   € ä#Ô%Ü�D‹zÐr)   c                óh   — t        «        | j                  | j                  j                  «       «      S )rÖ   )r®  rã  r™  r×   r-   s    r'   r×   zTypedStorage.cpuƒ  s(   € ä#Ô%Ø×(Ñ(¨×)>Ñ)>×)BÑ)BÓ)DÓEÐEr)   c                óL   — t        «        | j                  j                  |«      S )a2  Determine whether the CPU TypedStorage is already pinned on device.

        Args:
            device (str or torch.device): The device to pin memory on (default: ``'cuda'``).
                This argument is discouraged and subject to deprecated.

        Returns:
            A boolean variable.
        )r®  r™  r   r!  s     r'   r   zTypedStorage.is_pinnedˆ  s!   € ô 	$Ô%Ø×$Ñ$×.Ñ.¨vÓ6Ð6r)   c                ól   — t        «        | j                  | j                  j                  |¬«      «      S )a8  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'``).
                This argument is discouraged and subject to deprecated.

        Returns:
            A pinned CPU storage.
        ri   )r®  rã  r™  r#  r!  s     r'   r#  zTypedStorage.pin_memory•  s4   € ô 	$Ô%Ø×(Ñ(Ø×!Ñ!×,Ñ,°FÐ,Ó;ó
ð 	
r)   c                ó6   — t        «        | j                  «       S )r'  )r®  Ú_share_memory_r-   s    r'   r.  zTypedStorage.share_memory_¤  s   € ä#Ô%Ø×"Ñ"Ó$Ð$r)   c                ó:   — | j                   j                  «        | S r!   )r™  r.  r-   s    r'   r  zTypedStorage._share_memory_ª  s   € Ø×Ñ×+Ñ+Ô-Øˆr)   ri   c               óÈ   — |€d}t        j                  |«      }t         j                  j                  || j	                  «       z  |¬«      }t        || j                  d¬«      S )r0  r×   ri   TrÑ  )rH   r   r   r1  r8  r   rB   )r$   r@   r   r$  s       r'   r1  zTypedStorage._new_shared®  sb   € àˆ>ØˆFÜ—‘˜fÓ%ˆÜ×.Ñ.×:Ñ:Ø�4×%Ñ%Ó'Ñ'°ð ;ó 
ˆô Ø(°·
±
Àdô
ð 	
r)   c                ó.   — | j                   j                  S r!   )r™  r   r-   s    r'   r   zTypedStorage._cdataº  s   € à×$Ñ$×+Ñ+Ð+r)   c                óB   — t        «        | j                  j                  S r!   )r®  r™  r   r-   s    r'   r   zTypedStorage.device¾  s   € ä#Ô%Ø×$Ñ$×+Ñ+Ð+r)   c                ó6   — t        «        | j                  «       S r!   rå  r-   s    r'   r@   zTypedStorage.sizeÃ  ræ  r)   c                óX   — | j                   j                  «       | j                  «       z  S r!   )r™  r>   r8  r-   s    r'   rÇ  zTypedStorage._sizeÈ  s'   € ð ×$Ñ$×+Ñ+Ó-°×1CÑ1CÓ1EÑEÐEr)   c                ó6   — t        «        | j                  «       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‘  rB   ÚKeyError)r$   Úes     r'   r%  z!TypedStorage._pickle_storage_typeÒ  sG   € ð	KÜ-Ó/°·
±
Ñ;Ð;øÜò 	KÜ˜V D§J¡J <Ð/AÐBÓCÈÐJûð	Kús   ‚ ™	A¢<¼Ac                óˆ   — t        j                  «       }t        j                  | |d¬«       t        |j                  «       ffS r¾   rÀ   rÆ   s     r'   rÈ   zTypedStorage.__reduce__Ø  rÉ   r)   c                ó6   — t        «        | j                  «       S r!   )r®  Ú	_data_ptrr-   s    r'   rT   zTypedStorage.data_ptrÝ  s   € Ü#Ô%Ø�~‰~ÓÐr)   c                ó6   — | j                   j                  «       S r!   )r™  rT   r-   s    r'   r,  zTypedStorage._data_ptrâ  s   € Ø×$Ñ$×-Ñ-Ó/Ð/r)   c                óJ   — t        «        | j                  j                  «       S r!   )r®  r™  rV   r-   s    r'   rV   zTypedStorage.resizableå  s   € Ü#Ô%Ø×$Ñ$×.Ñ.Ó0Ð0r)   c                ó:   — t        «        | j                  |«       y r!   )r®  Ú_resize_rv   s     r'   rw   zTypedStorage.resize_é  s   € Ü#Ô%Ø�‰�dÕr)   c                ó\   — | j                   j                  || j                  «       z  «       y r!   )r™  rw   r8  rv   s     r'   r0  zTypedStorage._resize_î  s$   € Ø×Ñ×%Ñ% d¨T×-?Ñ-?Ó-AÑ&AÕBr)   c                ó,   — t        j                  |i |¤ŽS r!   )r   r‡   rc   s      r'   r‡   zTypedStorage._free_weak_refñ  s   € ä×,Ñ,¨dÐ=°fÑ=Ð=r)   c                ó:   —  | j                   j                  |i |¤ŽS r!   )r™  ry   r#   s      r'   ry   zTypedStorage._weak_refõ  s    € Ø.ˆt×$Ñ$×.Ñ.°Ð?¸Ñ?Ð?r)   c                ó:   — t        «         | j                  |i |¤ŽS r!   )r®  Ú_from_bufferrc   s      r'   rd   zTypedStorage.from_bufferø  s    € ä#Ô%Øˆs×Ñ Ð0¨Ñ0Ð0r)   rÝ   c               óÎ  — | t         k(  rz|€t        j                  «       n|}t        j                  |€dn|«      }|j                  dk7  rt        d|j                  › �«      ‚t        j                  j                  |d|i|¤Ž}nU|€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 rB   é   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   rH   rÜ  r   rC   rÓ  r   rd   r¨   rÂ  )r]   rB   r   r%   r&   r$  s         r'   r5  zTypedStorage._from_bufferý  s
  € à”,ÒØ16°”E×+Ñ+Ô-ÀEˆEÜ—\‘\¨6¨>¡%¸vÓFˆFØ�{‰{˜eÒ#Ü"ØIÈ&Ï+É+ÈÐWóð ô 5:×4HÑ4H×4TÑ4TØð5Ø"ð5Ø&,ñ5‰Oð
 Ð ¤C¨£I°¢NÜ"ðNóð ð Ð!Ü"ðNóð ð
 —J‘JˆEÜ#×2Ñ2×>Ñ>ØðØ"ðØ&,ñˆOô ¨ÀÐQUÔVÐVr)   c                óz  — t        |t        j                  «      st        dt	        |«      › �«      ‚t        j
                  g | j                  | j                  ¬«      j                  | «      j                  |«      j                  «       }|j                  «       | j                  «       k(  r|j                  «       }|S rÜ   )rÞ   rH   rB   rß   rC   rà   r   râ   rI   rã   rT   r¶   rä   s      r'   r   zTypedStorage._to  s‡   € Ü˜%¤§¡Ô-ÜÐHÌÈeËÈÐVÓWÐWä�L‰L˜ 4§:¡:°d·k±kÔBß‰T�$‹Zß‰R�‹Yß‰^Óð	 	ð ×ÑÓ §¡£Ò0Ø—m‘m“oˆGØˆr)   c                óT   — t        «        | j                  t        j                  «      S ré   )r®  r   rH   rê   r-   s    r'   rê   zTypedStorage.double*  ó   € ä#Ô%Ø�x‰xœŸ™Ó%Ð%r)   c                óT   — t        «        | j                  t        j                  «      S rí   )r®  r   rH   rî   r-   s    r'   rî   zTypedStorage.float/  ó   € ä#Ô%Ø�x‰xœŸ™Ó$Ð$r)   c                óT   — t        «        | j                  t        j                  «      S rñ   )r®  r   rH   rò   r-   s    r'   rò   zTypedStorage.half4  ó   € ä#Ô%Ø�x‰xœŸ
™
Ó#Ð#r)   c                óT   — t        «        | j                  t        j                  «      S rõ   )r®  r   rH   rö   r-   s    r'   rö   zTypedStorage.long9  r>  r)   c                óT   — t        «        | j                  t        j                  «      S rø   )r®  r   rH   rù   r-   s    r'   rù   zTypedStorage.int>  s   € ä#Ô%Ø�x‰xœŸ	™	Ó"Ð"r)   c                óT   — t        «        | j                  t        j                  «      S rû   )r®  r   rH   rü   r-   s    r'   rü   zTypedStorage.shortC  r<  r)   c                óT   — t        «        | j                  t        j                  «      S rþ   )r®  r   rH   rÿ   r-   s    r'   r   zTypedStorage.charH  r>  r)   c                óT   — t        «        | j                  t        j                  «      S r  )r®  r   rH   rá   r-   s    r'   r  zTypedStorage.byteM  r<  r)   c                óT   — t        «        | j                  t        j                  «      S r  )r®  r   rH   r  r-   s    r'   r  zTypedStorage.boolR  r>  r)   c                óT   — t        «        | j                  t        j                  «      S r  )r®  r   rH   r	  r-   s    r'   r	  zTypedStorage.bfloat16W  s   € ä#Ô%Ø�x‰xœŸ™Ó'Ð'r)   c                óT   — t        «        | j                  t        j                  «      S r  )r®  r   rH   r  r-   s    r'   r  zTypedStorage.complex_double\  s   € ä#Ô%Ø�x‰xœŸ™Ó&Ð&r)   c                óT   — t        «        | j                  t        j                  «      S r  )r®  r   rH   r  r-   s    r'   r  zTypedStorage.complex_floata  r:  r)   c                óT   — t        «        | j                  t        j                  «      S r  )r®  r   rH   r  r-   s    r'   r  zTypedStorage.float8_e5m2f  s   € ä#Ô%Ø�x‰xœ×)Ñ)Ó*Ð*r)   c                óT   — t        «        | j                  t        j                  «      S r  )r®  r   rH   r  r-   s    r'   r  zTypedStorage.float8_e4m3fnk  s   € ä#Ô%Ø�x‰xœ×+Ñ+Ó,Ð,r)   c                óT   — t        «        | j                  t        j                  «      S r  )r®  r   rH   r  r-   s    r'   r  zTypedStorage.float8_e5m2fnuzp  ó   € ä#Ô%Ø�x‰xœ×-Ñ-Ó.Ð.r)   c                óT   — t        «        | j                  t        j                  «      S r  )r®  r   rH   r  r-   s    r'   r  zTypedStorage.float8_e4m3fnuzu  rK  r)   c                óÖ   — t        «        | t        k(  rt        d«      ‚t        j	                  |||t
        j                  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�   rH   r7  r8  rB   )r]   r�   rŽ   r@   r$  rå   s         r'   r�   zTypedStorage.from_filez  s^   € ô( 	$Ô%Ø”,ÒÜÐPÓQÐQÜ(×2Ñ2Ø�f˜d¤U§\¡\×%?Ñ%?ÀÇ	Á	Ó%JÑJó
ˆñ  ?Ô3ˆØˆr)   c                ó,   — t        j                  |i |¤ŽS r!   )r   r‘   rc   s      r'   r‘   zTypedStorage._expired—  s   € ä×&Ñ&¨Ð7°Ñ7Ð7r)   c                ó:   —  | j                   j                  |i |¤ŽS r!   )r™  rt   r#   s      r'   rt   zTypedStorage._write_file›  s    € Ø0ˆt×$Ñ$×0Ñ0°$ÐA¸&ÑAÐAr)   c                ó:   —  | j                   j                  |i |¤ŽS r!   )r™  r{   r#   s      r'   r{   zTypedStorage._set_from_filež  ó    € Ø3ˆt×$Ñ$×3Ñ3°TÐD¸VÑ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Ñ1°4ÐB¸6ÑBÐBr)   c                ó6   — t        «        | j                  «       S r!   )r®  Ú
_is_sharedr-   s    r'   r�   zTypedStorage.is_shared§  s   € Ü#Ô%Ø�‰Ó Ð r)   c                ó6   — | j                   j                  «       S r!   )r™  r�   r-   s    r'   rU  zTypedStorage._is_shared¬  s   € Ø×$Ñ$×.Ñ.Ó0Ð0r)   c                ó@   — t        j                  j                  |i |¤ŽS r!   )rH   r   rƒ   rc   s      r'   rƒ   zTypedStorage._new_shared_cuda¯  s   € ä×#Ñ#×4Ñ4°dÐE¸fÑEÐEr)   c                ón   —  | j                   j                  |i |¤Ž\  }}}|||| j                  «       z  fS r!   )r™  rX   r8  )r$   r%   r&   Úmanager_handleÚstorage_handler@   s         r'   rX   z!TypedStorage._share_filename_cpu_³  sH   € ð
 7ˆD×!Ñ!×6Ñ6¸ÐGÀÑGñ		
ØØØà˜~¨t°t×7IÑ7IÓ7KÑ/KÐKÐKr)   c                ó:   — | j                   j                  «        | S r!   )r™  rr   r-   s    r'   rr   zTypedStorage._shared_decref»  s   € Ø×Ñ×,Ñ,Ô.Øˆr)   c               ó@   — t        j                  j                  |i |¤ŽS r!   ©rH   r   rk   rl   s       r'   rm   z!TypedStorage._release_ipc_counter¿  ó   € ä×#Ñ#×=Ñ=¸tÐNÀvÑNÐNr)   c                ó:   —  | j                   j                  |i |¤ŽS r!   )r™  r…   r#   s      r'   r…   zTypedStorage._shared_increfÃ  rQ  r)   c                ój   —  | j                   j                  |i |¤Ž\  }}||| j                  «       z  fS r!   )r™  rZ   r8  )r$   r%   r&   Úfdr@   s        r'   rZ   zTypedStorage._share_fd_cpu_Æ  s<   € Ø7�4×(Ñ(×7Ñ7¸ÐHÀÑH‰ˆˆDØ�4˜4×-Ñ-Ó/Ñ/Ð/Ð/r)   c                óŽ  — | j                   t        «       vry t        «       | j                      }| j                  j                  dddt        j
                  j                  «       fvry | j                  j                  dk(  rt        n#t        t        | j                  j                  «      }	 t        ||«      S # t        $ r Y y w xY w)Nr×   rE   rM   )	rB   r‘  r   rC   rH   r,  r-  ÚgetattrÚAttributeError)r$   Ústorage_namer¼  s      r'   rý  z&TypedStorage._get_legacy_storage_classÊ  s­   € Ø�:‰:Ô7Ó9Ñ9Øä1Ó3°D·J±JÑ?ˆà�;‰;×ÑØØØÜ�H‰H×2Ñ2Ó4ð	$
ñ 
ð ð —[‘[×%Ñ%¨Ò.�E´G¼EÀ4Ç;Á;×CSÑCSÓ4Tð 	ð	Ü˜6 <Ó0Ð0øÜò 	Ùð	ús   Â,B8 Â8	CÃCrB  rA  )Fr!   )r8   r   r9   z_Optional[bool]r?  )rB   r@  r9   r  r>  z&Union[_StorageBase, TypedStorage, str])r   r   r9   r  r>  r
   r=  rC  rD  )arE  rF  rG  r   rH  r   rJ  rÂ  r�   rÉ  rÔ  r(   r‰   r‹   r3  rã  r.   rì  r5   rÅ  r3   rò  r:   r>   rú  rC   rE   rM   rI   rO   r8  rR   r  r®   r´   r·   r¼   r  rÌ   r¶   rÔ   r×   r   r#  r.  r  r1  r   r   r@   rÇ  r&  r%  rÈ   rT   r,  rV   rw   r0  rI  r‡   ry   rd   r5  r   rê   rî   rò   rö   rù   rü   r   r  r  r	  r  r  r  r  r  r  r�   r‘   rt   r{   r}   r   r�   rU  rƒ   rX   rr   rm   r…   rZ   rý  rK  rL  s   @r'   r   r   Ÿ  s
  ø… Ø€IˆuÓà,0€LÐ)Ó0àÓàñó ðð ò.ó ð.ò
ð ØØØöZð~ ØØØôYVðv ñ;ó ð;ð ñ:ó ð:ò%ó
<òó*ò4)ò! òF"ò*2ôXòò
.ð
 !%Ø"ðCàðCð ðCð 
0ó	Cô"7ô6ð BGõ 5ò"$ò
6ó2ò
.òò9òKò$ò
Uô4òHò
ò
Fô
7ô
ò%òð +/ô 

ð ñ,ó ð,ð ñ,ó ð,òò
Fò
+ò
Kò3ò
 ò
0ò1òò
Cð ñ>ó ð>ò@ð ñ1ó ð1ð Ø'+°Dó Wó ðWò>ò&ò
%ò
$ò
$ò
#ò
%ò
$ò
%ò
$ò
(ò
'ò
&ò
+ò
-ò
/ò
/ð
 ñó ðð8 ñ8ó ð8òBòEòAòCò!ò
1ð ñFó ðFòLòð Ø04ó Oó ðOòEò0ör)   c                  ó   — e Zd ZU ded<   d„ Zy)Ú_LegacyStorageMetarÀ  rB   c                óº   — t        |«      t        k(  rIt        | j                  «      }||j                  j                   k(  xr | j
                  |j
                  k(  S yr?  )rC   r   r¾  rF  r   rB   )r]   ÚinstancerÙ  s      r'   Ú__instancecheck__z$_LegacyStorageMeta.__instancecheck__ë  sM   € Ü�‹>œ\Ò)Ü0°·±Ó@ˆJØ (§/¡/×"6Ñ"6Ñ6ò Ø—	‘	˜XŸ^™^Ñ+ðð r)   N)rE  rF  rG  rH  rj  r"   r)   r'   rg  rg  è  s   … ØÓór)   rg  c                  ó<   — e Zd Zed„ «       Zed„ «       Zed„ «       Zy)rÒ  c                ó~   — t         j                  j                  | | «       j                  «       z  «      } | |¬«      S )r0  râ  )rH   r   r1  r8  )r]   r@   r$  s      r'   r1  z_LegacyStorage._new_sharedõ  s5   € ô  ×.Ñ.×:Ñ:¸4Á#Ã%×BUÑBUÓBWÑ;WÓXˆÙ Ô0Ð0r)   c                ó@   — t        j                  j                  |i |¤ŽS r!   r]  rc   s      r'   rm   z#_LegacyStorage._release_ipc_counterû  r^  r)   c                óª   — |t         j                  j                  | j                  «      z  } | t         j                  j                  |||«      ¬«      S )Nrâ  )rH   r7  r8  rB   r   rh   )r]   rf   rg   r@   Ú
bytes_sizes        r'   Ú_new_shared_filenamez#_LegacyStorage._new_shared_filenameÿ  sG   € àœEŸL™L×6Ñ6°s·y±yÓAÑAˆ
ÙÜ×-Ñ-×FÑFØ˜˜jóô
ð 	
r)   N)rE  rF  rG  rI  r1  rm   rp  r"   r)   r'   rÒ  rÒ  ô  s>   „ Øñ1ó ð1ð
 ñOó ðOð ñ
ó ñ
r)   rÒ  )Ú	metaclassc                ó`   — 	 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_typers  	  sE   € ðÜ)Ó+Ð,?Ñ@Ð@øÜò ÜØ#Ð$7Ð#8Ð8KÐLó
àð	ûðús   ‚ �	-˜(¨-)r5  )r¼  r    )r&  r    )AÚ
__future__r   rÕ  r  rY  rÁ   rP  r²  Útypingr   r   r   Ú	_Optionalr   r   r	   Útyping_extensionsr
   rH   Útorch._utilsr   r   Útorch.typesr   r   r   Útorch._prims_commonr   Ú__all__Únumpyr   rŸ  ÚModuleNotFoundErrorÚLockrO  r   rH  r   r   r[  r,  ÚStorageBaser   rÄ   Úcacherx  r‘  r–  r�  r£  r¥  r¦  r©  r®  r·  r¾  r   Ú__doc__rC   rE   rM   rI   rg  rÒ  rs  r"   r)   r'   ú<module>r‚     sÅ  ðö #ã Û Û Û 	Û Û ß R× RÝ "ã ß #ß ,Ñ ,ñ Ý2ð Ð+Ð
,€ðÛà€Ið $�Y—^‘^Ó%Ð Ø02Ð Ð-Ó 2áˆCÐ:Ô;€÷B"ñ B"òJ!ôH@=�U—X‘X×)Ñ)¨<ô @=òF9ð ‡�ñó ðð, ‡�ñó ðð6 ‡�ñó ðò
8ò2"ð &+Ð "ò.ò5óBò(?ó÷@ñ @ðF "ŸM™M€× Ñ Ô Ø(×-Ñ-×5Ñ5€× Ñ Ô Ø'×+Ñ+×3Ñ3€× Ñ Ô ØŸ+™+€‡�Ô ô	˜ô 	ô
�\Ð-?õ 
ô*øðW/ ò Ø€IØ	ƒBðús   ÁF' Æ'	F4Æ3F4