+
    &j                      a  0 t $ ^ RIHt ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	H
t
HtHtHt ^ RIHt ^ RIt^ RIHtHt ^ RIHtHtHt ]'       d   ^ RIHt RR	.t ^ RItR
t]P>                  ! 4       t / t!R]"R&   ]! RRR7      t# ! R R4      t$R t% ! R R	]PL                  PN                  ]$4      t(R t)]PT                  R 4       t+]PT                  R 4       t,]PT                  R 4       t-R t.R t/Rs0R t1R t2R)R lt3R t4R R  lt5 ! R! R4      t6]Pn                  ]6Pp                  n7        ]$Pr                  Pn                  ]6Pr                  n7        ]$Pt                  Pn                  ]6Pt                  n7        ]Pn                  ]6Pv                  n7         ! R" R#]84      t< ! R$ R%]6]<R&7      t=R' R( lt>R#   ] d	    RtRt EL\i ; i)*    )annotationsN)AnycastTYPE_CHECKINGTypeVar)Self)_to_type)_bool_intStorage)DeviceLikeTypeTypedStorageUntypedStorageTFzdict[int, threading.RLock]_share_memory_mapT_StorageBase | TypedStorage)boundc                    a  ] tR t^)t$ R]R&   RtR]R&   RtR]R&   R]R&   R	tR
]R&   R	tR]R&   R t	R R lt
R tR tRzR R lltR R ltR R ltR R ltR{R R lltR{R R lltR{R R  lltR! R" ltR# R$ ltR% R& ltR' R( ltR) tR* t]R+ R, l4       t]R- R. l4       t]R/ R0 l4       t]RR	R1R	/R2 R3 ll4       t]RR	/R4 l4       t]R5 R6 l4       t ]R7 R8 l4       t!R9 R: lt"R; t#R< R= lt$R> R? lt%R@ t&RA t'RB t(RC RD lt)]RE RF l4       t*RG t+]RH 4       t,]-RI 4       t.]-RJ 4       t/]RK RL l4       t0]RM RN l4       t1RO t2RP RQ lt3RR t4RS t5RT t6RU t7RV t8V 3RW lt9RX t:RY t;RZ t<R[ t=R\ t>R]R/R^ R_ llt?R` t@Ra tARb tBRc tCRd tDRe tERf tFRg tGRh tHRi tIRj tJRk tKRl tLRm tMRn tNRo tOR|Rp Rq lltPR|Rr Rs lltQRt tR]RRu/Rv l4       tSRw tTRx tURytVV ;tW# )}_StorageBaser   _cdataFr   	is_sparseis_sparse_csrztorch.devicedeviceNtorch.device | None_fake_devicez
int | None_checkpoint_offsetc                	    R # N selfargskwargss   &*,e/Users/jameslopez/projects/CWCArchive/cwc-podcast/.venv/lib/python3.14/site-packages/torch/storage.py__init___StorageBase.__init__5   s        c                   V ^8  d   QhRR/#    returnr   r    )formats   "r%   __annotate___StorageBase.__annotate__8   s     " " "r(   c                	    \         hr   NotImplementedErrorr"   s   &r%   __len___StorageBase.__len__8       !!r(   c                	    \         hr   r1   r"   idxs   &&r%   __getitem___StorageBase.__getitem__;   r6   r(   c                	    \         hr   r1   r!   s   &*,r%   __setitem___StorageBase.__setitem__>   r6   r(   c               $    V ^8  d   QhRRRRRR/# )r+   sourcer   non_blockingz_bool | Noner,   r    )r-   s   "r%   r.   r/   A   s!     " "A "\ "Q "r(   c                	    \         hr   r1   r"   r@   rA   s   &&&r%   copy__StorageBase.copy_A   r6   r(   c                   V ^8  d   QhRR/# r+   r,   r   r    )r-   s   "r%   r.   r/   D   s     " "0 "r(   c                	    \         hr   r1   r3   s   &r%   new_StorageBase.newD   r6   r(   c                   V ^8  d   QhRR/# r*   r    )r-   s   "r%   r.   r/   G   s     " " "r(   c                	    \         hr   r1   r3   s   &r%   nbytes_StorageBase.nbytesG   r6   r(   c                   V ^8  d   QhRR/# r*   r    )r-   s   "r%   r.   r/   J   s      d r(   c                	"    V P                  4       # r   )rM   r3   s   &r%   size_StorageBase.sizeJ   s    {{}r(   c               $    V ^8  d   QhRRRRRR/# )r+   dtype
str | NonerA   r   r,   r   r    )r-   s   "r%   r.   r/   M   s$     0 006;0	$0r(   c                	    \        WV4      # r   )r
   )r"   rT   rA   s   &&&r%   type_StorageBase.typeM   s     T,//r(   c                   V ^8  d   QhRR/# rG   r    )r-   s   "r%   r.   r/   R   s     B B7R Br(   c                    V'       d   \         P                  ! RV4      M\         P                  ! R4      pV P                  W2R7      # )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   rA   torchr   tor"   r   rA   device2s   &&& r%   r[   _StorageBase.cudaR   s2     39%,,vv.ell6>RwwgwAAr(   c                   V ^8  d   QhRR/# rG   r    )r-   s   "r%   r.   r/   a   s     B B6Q Br(   c                    V'       d   \         P                  ! RV4      M\         P                  ! R4      pV P                  W2R7      # )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.
hpur\   r]   r`   s   &&& r%   re   _StorageBase.hpua   s2     28%,,uf-U\\%=PwwgwAAr(   c                   V ^8  d   QhRR/# r*   r    )r-   s   "r%   r.   r/   p   s     " "d "r(   c                	    \         hr   r1   r3   s   &r%   element_size_StorageBase.element_sizep   r6   r(   c                   V ^8  d   QhRR/# r*   r    )r-   s   "r%   r.   r/   s   s     ! !D !r(   c                	.    V P                   P                  # r   )r   indexr3   s   &r%   
get_device_StorageBase.get_devices   s    {{   r(   c                   V ^8  d   QhRR/# r*   r    )r-   s   "r%   r.   r/   v   s     " "$ "r(   c                	    \         hr   r1   r3   s   &r%   data_ptr_StorageBase.data_ptrv   r6   r(   c                   V ^8  d   QhRR/# r+   r,   r   r    )r-   s   "r%   r.   r/   y        " "5 "r(   c                	    \         hr   r1   r3   s   &r%   	resizable_StorageBase.resizabley   r6   r(   c                	    \         hr   r1   r!   s   &*,r%   _share_filename_cpu_!_StorageBase._share_filename_cpu_}   r6   r(   c                	    \         hr   r1   r!   s   &*,r%   _share_fd_cpu__StorageBase._share_fd_cpu_   r6   r(   c                    V ^8  d   QhRRRR/# r+   rQ   r   r,   r   r    )r-   s   "r%   r.   r/      s     " "4 "D "r(   c                	    \         hr   r1   clsrQ   s   &&r%   _new_using_filename_cpu$_StorageBase._new_using_filename_cpu       !!r(   c                    V ^8  d   QhRRRR/# r   r    )r-   s   "r%   r.   r/      s     " "T "d "r(   c                	    \         hr   r1   r   s   &&r%   _new_using_fd_cpu_StorageBase._new_using_fd_cpu   r   r(   c                   V ^8  d   QhRR/# r+   r,   r   r    )r-   s   "r%   r.   r/      s     " "T "r(   c                	    \         hr   r1   r   r#   r$   s   &*,r%   from_buffer_StorageBase.from_buffer   r   r(   rT   c                   V ^8  d   QhRR/# r   r    )r-   s   "r%   r.   r/      s     	" 	" 
	"r(   c               	    \         hr   r1   )r   managerobjrQ   r   rT   s   &&&&$$r%   _new_shared_filename_cpu%_StorageBase._new_shared_filename_cpu   s
     "!r(   c               	&    V P                   ! V/ VB # r   )_release_ipc_counter_cudar   r   r#   r$   s   &$*,r%   _release_ipc_counter!_StorageBase._release_ipc_counter   s    ,,d=f==r(   c                   V ^8  d   QhRR/# r   r    )r-   s   "r%   r.   r/      s     " "4 "r(   c                	    \         hr   r1   r   s   &*,r%   r   &_StorageBase._release_ipc_counter_cuda   r   r(   c                   V ^8  d   QhRR/# r   r    )r-   s   "r%   r.   r/      s     " "D "r(   c                	    \         hr   r1   r   s   &*,r%   _new_with_weak_ptr_StorageBase._new_with_weak_ptr   r   r(   c                   V ^8  d   QhRR/# rG   r    )r-   s   "r%   r.   r/      s     " " ; "r(   c                	    \         hr   r1   r3   s   &r%   _shared_decref_StorageBase._shared_decref   r6   r(   c                	    \         hr   r1   r!   s   &*,r%   _write_file_StorageBase._write_file   r6   r(   c                   V ^8  d   QhRR/# )r+   rQ   r   r    )r-   s   "r%   r.   r/      s     " "D "r(   c                	    \         hr   r1   r"   rQ   s   &&r%   resize__StorageBase.resize_   r6   r(   c                   V ^8  d   QhRR/# rG   r    )r-   s   "r%   r.   r/      s     " ",G "r(   c                	    \         hr   r1   r!   s   &*,r%   	_weak_ref_StorageBase._weak_ref   r6   r(   c                	    \         hr   r1   r!   s   &*,r%   _set_from_file_StorageBase._set_from_file   r6   r(   c                	    \         hr   r1   r!   s   &*,r%   
_set_cdata_StorageBase._set_cdata   r6   r(   c                	    \         hr   r1   r!   s   &*,r%   _share_cuda__StorageBase._share_cuda_   r6   r(   c                   V ^8  d   QhRR/# ru   r    )r-   s   "r%   r.   r/      rv   r(   c                	    \         hr   r1   r3   s   &r%   	is_shared_StorageBase.is_shared   r6   r(   c                   V ^8  d   QhRR/# r   r    )r-   s   "r%   r.   r/      s     " "$ "r(   c                	    \         hr   r1   r   s   &*,r%   _new_shared_cuda_StorageBase._new_shared_cuda   r   r(   c                	    \         hr   r1   r!   s   &*,r%   _shared_incref_StorageBase._shared_incref   r6   r(   c                	    \         hr   r1   r   s   &*,r%   _free_weak_ref_StorageBase._free_weak_ref   r   r(   c                	    \         hr   r1   r3   s   &r%   is_cuda_StorageBase.is_cuda   r   r(   c                	    \         hr   r1   r3   s   &r%   is_hpu_StorageBase.is_hpu   r   r(   c                   V ^8  d   QhRR/# rG   r    )r-   s   "r%   r.   r/      s     " "4O "r(   c                	    \         hr   r1   )r   filenamesharedrM   s   &&&&r%   	from_file_StorageBase.from_file   r   r(   c                   V ^8  d   QhRR/# rG   r    )r-   s   "r%   r.   r/      s     " "*E "r(   c                	    \         hr   r1   r   s   &*,r%   _expired_StorageBase._expired   r   r(   c                	    \         hr   r1   r!   s   &*,r%   	_byteswap_StorageBase._byteswap   r6   r(   c                   V ^8  d   QhRR/# r+   r,   rU   r    )r-   s   "r%   r.   r/      s     " "
 "r(   c                	    \         hr   r1   r!   s   &*,r%   _get_filename_StorageBase._get_filename   r6   r(   c                	D  a  R \         P                  ! S 4       RS P                   R\        S 4       R2pS P                  P                  R8X  d
   RV,           # RRP                  V 3R l\        S P                  4       4       4       4      ,           pVR	,           V,           # )
[z(device=
) of size ]meta...
 
 c              3  H   <"   T F  p\        SV,          4      x  K  	  R # 5ir   str.0ir"   s   & r%   	<genexpr>(_StorageBase.__repr__.<locals>.<genexpr>   s     #M:LQCQLL:L   "
)r^   typenamer   lenrW   joinrangerQ   r"   info_strdata_strs   f  r%   __repr___StorageBase.__repr__   s    u~~d+,HT[[MCPTI;VWX;;v%X%%#M%		:L#MMM$))r(   c                	\   a  \        V 3R  l\        S P                  4       4       4       4      # )c              3  6   <"   T F  pSV,          x  K  	  R # 5ir   r    r   s   & r%   r   (_StorageBase.__iter__.<locals>.<genexpr>        8%7DGG%7   )iterr   rQ   r3   s   fr%   __iter___StorageBase.__iter__   s    8U499;%7888r(   c                	"    V P                  4       # r   )cloner3   s   &r%   __copy___StorageBase.__copy__   s    zz|r(   c                	    VP                  R / 4      pV P                  V9   d   WP                  ,          # V P                  4       pW!V P                  &   V# )r^   )
setdefaultr   r  )r"   memonew_storages   && r%   __deepcopy___StorageBase.__deepcopy__   sH    w+;;$$$jjl'T[[r(   c                	    \         P                  ! 4       p\        P                  ! WR R7       \        VP                  4       33# F)_use_new_zipfile_serializationioBytesIOr^   save_load_from_bytesgetvaluer"   bs   & r%   
__reduce___StorageBase.__reduce__   .    JJL

45A 1::</22r(   c                	J   < \         SV `  4       V P                  4       ,           # r   )super
__sizeof__rQ   r"   	__class__s   &r%   r   _StorageBase.__sizeof__   s    w!#diik11r(   c                v    \        V 4      ! V P                  4       V P                  R7      P                  V 4      # )Return a copy of this storage.r   )rW   rM   r   rD   r3   s   &r%   r  _StorageBase.clone   s(    Dz$++-<BB4HHr(   c                    \        V 4      # z6Return a list containing the elements of this storage.)listr3   s   &r%   tolist_StorageBase.tolist  s    Dzr(   c                    V P                   P                  R8w  d5   \        P                  ! V P	                  4       4      P                  V R4      # V # )AReturn a CPU copy of this storage if it's not already on the CPU.cpuFr   rW   r^   r   rQ   rD   r3   s   &r%   r/  _StorageBase.cpu  s=    ;;u$''		4::4GGr(   c                    V P                   P                  R8w  d7   \        P                  ! V P	                  4       RR7      P                  V R4      # V # )zAReturn a MPS copy of this storage if it's not already on the MPS.mpsr&  Fr0  r3   s   &r%   r3  _StorageBase.mps  s?    ;;u$''		EBHHuUUr(   c                	   \        V\        P                  4      '       g   \        R \	        V4       24      h\        P
                  ! . \        P                  V P                  R7      P                  \        \        V 4      4      P                  V4      P                  4       pVP                  4       V P                  4       8X  d   VP                  4       pV# z*Argument 'dtype' must be torch.dtype, not rT   r   )
isinstancer^   rT   	TypeErrorrW   tensoruint8r   set_r   r   r_   _typed_storagerr   r  r"   rT   storages   && r%   r	   _StorageBase._to  s    %--HeVWWLL5;;t{{CT$w%&RY^	 	 0mmoGr(   rA   c                    V ^8  d   QhRRRR/# )r+   r   r   rA   r   r    )r-   s   "r%   r.   r/     s     / /N /% /r(   c               	    \        V\        P                  4      '       g   \        P                  ! V4      p\        WV4      # r   )r8  r^   r   r	   )r"   r   rA   s   &$$r%   r_   _StorageBase.to  s.    &%,,//\\&)F4..r(   c                @    V P                  \        P                  4      # z"Casts this storage to double type.)r	   r^   doubler3   s   &r%   rF  _StorageBase.double#      xx%%r(   c                @    V P                  \        P                  4      # z!Casts this storage to float type.)r	   r^   floatr3   s   &r%   rK  _StorageBase.float'      xx$$r(   c                @    V P                  \        P                  4      # z Casts this storage to half type.)r	   r^   halfr3   s   &r%   rP  _StorageBase.half+      xx

##r(   c                @    V P                  \        P                  4      # z Casts this storage to long type.)r	   r^   longr3   s   &r%   rU  _StorageBase.long/  rR  r(   c                @    V P                  \        P                  4      # zCasts this storage to int type.)r	   r^   intr3   s   &r%   rY  _StorageBase.int3  s    xx		""r(   c                @    V P                  \        P                  4      # z!Casts this storage to short type.)r	   r^   shortr3   s   &r%   r]  _StorageBase.short7  rM  r(   c                @    V P                  \        P                  4      # z Casts this storage to char type.)r	   r^   int8r3   s   &r%   char_StorageBase.char;  rR  r(   c                @    V P                  \        P                  4      # z Casts this storage to byte type.)r	   r^   r;  r3   s   &r%   byte_StorageBase.byte?  rM  r(   c                @    V P                  \        P                  4      # z Casts this storage to bool type.)r	   r^   boolr3   s   &r%   rj  _StorageBase.boolC  rR  r(   c                @    V P                  \        P                  4      # z$Casts this storage to bfloat16 type.)r	   r^   bfloat16r3   s   &r%   rn  _StorageBase.bfloat16G  s    xx''r(   c                @    V P                  \        P                  4      # z*Casts this storage to complex double type.)r	   r^   cdoubler3   s   &r%   complex_double_StorageBase.complex_doubleK  s    xx&&r(   c                @    V P                  \        P                  4      # z)Casts this storage to complex float type.)r	   r^   cfloatr3   s   &r%   complex_float_StorageBase.complex_floatO  rH  r(   c                @    V P                  \        P                  4      # z&Casts this storage to float8_e5m2 type)r	   r^   float8_e5m2r3   s   &r%   r|  _StorageBase.float8_e5m2S  s    xx))**r(   c                @    V P                  \        P                  4      # z(Casts this storage to float8_e4m3fn type)r	   r^   float8_e4m3fnr3   s   &r%   r  _StorageBase.float8_e4m3fnW  s    xx++,,r(   c                @    V P                  \        P                  4      # z*Casts this storage to float8_e5m2fnuz type)r	   r^   float8_e5m2fnuzr3   s   &r%   r  _StorageBase.float8_e5m2fnuz[      xx--..r(   c                @    V P                  \        P                  4      # z*Casts this storage to float8_e4m3fnuz type)r	   r^   float8_e4m3fnuzr3   s   &r%   r  _StorageBase.float8_e4m3fnuz_  r  r(   c                   V ^8  d   QhRR/# r+   r   zstr | torch.devicer    )r-   s   "r%   r.   r/   c  s     
 
 2 
r(   c                    \         P                  ! . \         P                  V P                  R7      P	                  \        \        V 4      4      P                  V4      # )zDetermine 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.
r7  )r^   r:  r;  r   r<  r   r   	is_pinnedr"   r   s   &&r%   r  _StorageBase.is_pinnedc  s<     LL5;;t{{CT$w%&Yv	
r(   c                   V ^8  d   QhRR/# r  r    )r-   s   "r%   r.   r/   s  s     / /!3 /r(   c                L   V P                   P                  R8w  d   \        RV P                  4        R24      h\        P                  ! . \        P
                  V P                   R7      P                  \        \        V 4      4      P                  V4      pVP                  4       # )a  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 pinnedr7  )r   rW   r9  r^   r:  r;  r<  r   r   
pin_memoryuntyped_storage)r"   r   pinned_tensors   && r%   r  _StorageBase.pin_memorys  s|     ;;u$l499;-7VWXX LL5;;t{{CT$w%&Z 	
 ,,..r(   c                    ^ RI Hp V P                  P                  R\        P
                  P                  4       39   d    V # V! 4       R8X  d   V P                  4        V # V P                  4        V # ).See :meth:`torch.UntypedStorage.share_memory_`get_sharing_strategyr[   file_system)	torch.multiprocessingr  r   rW   r^   _C_get_privateuse1_backend_namer{   r~   )r"   r  s   & r%   share_memory__StorageBase.share_memory_  sf    >;;(N(N(PQQ
 	 "#}4%%'  !r(   r/  c                  ^ RI Hp \        P                  ! V4      pVP                  R\        P
                  P                  4       R39   d
   V ! WR7      # V! 4       R8X  d   V P                  V4      # V P                  V4      # )>Create a new storage in shared memory with the same data type.r  r[   re   r&  r  )	r  r  r^   r   rW   r  r  r   r   )r   rQ   r   r  s   &&$ r%   _new_shared_StorageBase._new_shared  sm     	?f%;;6588#I#I#KUSSt++!#}4..t44((..r(   c                	    V # r   r    r3   s   &r%   untyped_StorageBase.untyped  s    r(   c                    \         P                  P                  V4      pVP                  '       d   \	        \        V^,          4      ^4      pV P                  V4       R# )zSwap bytes in underlying data.N)r^   _utils_element_size
is_complexmaxrY  r   )r"   rT   	elem_sizes   && r%   byteswap_StorageBase.byteswap  sC    LL..u5	C	A.2Iy!r(   r    r   NFr[   )X__name__
__module____qualname____firstlineno____annotations__r   r   r   r   r&   r4   r:   r=   rD   rI   rM   rQ   rW   r[   re   ri   rn   rr   rx   r{   r~   classmethodr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   propertyr   r   r   r   r   r   r   r  r  r  r  r   r  r+  r/  r3  r	   r_   rF  rK  rP  rU  rY  r]  rb  rf  rj  rn  rs  rx  r|  r  r  r  r  r  r  r  r  r  __static_attributes____classcell__r"  s   @r%   r   r   )   s   KIu M5  )-L%,%)
)""""""0
BB"!"""" " " " " " " 	" 	" 	" 	" > > > " " " """"""""" " "" " " " " " " " " " """*93
2I/% /
&%$$#%$%$('&+-//
 /(
 
/ 
/ 
/" "r(   r   c                F   a  \         P                  ! S 4      V 3R  l4       pV# )c           	       < R pR p\         ;_uu_ 4        V P                  pV\        9   d   \        V,          pM9\        P                  ! 4       \        V&   \        V,          P                  4        TpR R R 4       Ve   V;_uu_ 4         R R R 4        S! V .VO5/ VB Veg   V P                  V8w  d   \        RV RV P                   24      h\         ;_uu_ 4        \        V,          P                  4        \        V R R R 4       # #   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     # ; i  Tez   T P                  T8w  d   \        RT RT P                   24      h\         ;_uu_ 4        \        T,          P                  4        \        T R R R 4       i   + '       g   i     i ; ii ; i)Nz-storage cdata changed unexpectedly: expected z, got )_share_memory_lockr   r   	threadingRLockacquireAssertionErrorrelease)r"   r#   r$   to_freeto_waitkeyfns   &*,   r%   wrapper-_share_memory_lock_protected.<locals>.wrapper  s~   ++C''+C0)2):!#&!#&..0    	3d,T,V, " ;;')(GyPVW[WbWbVcd  ('%g.668)'2 (' #)    (' " ;;')(GyPVW[WbWbVcd  ('%g.668)'2 (''' #sH   AD
	DE #D0
D	D-	0E ?G#F.	%	G.F>9	G)	functoolswraps)r  r  s   f r%   _share_memory_lock_protectedr    s&    __R 3  3D Nr(   c                     a  ] tR tRtV 3R lt]R 4       t]R 4       t]R R l4       t]	V 3R l4       t
]	V 3R l4       t]	V 3R	 l4       tR
tV ;t# )r   i  c                	p   < V P                   P                  R 8X  d   \        R4      h\        SV `  ! V/ VB # )r   $Not available for 'meta' device type)r   rW   r2   r  r:   r"   r#   r$   r"  s   &*,r%   r:   UntypedStorage.__getitem__  s6    ;;v%%&LMMw"D3F33r(   c                	4    V P                   P                  R 8H  # r  r   rW   r3   s   &r%   r   UntypedStorage.is_cuda  s    {{6))r(   c                	4    V P                   P                  R 8H  # re   r  r3   s   &r%   r   UntypedStorage.is_hpu  s    {{5((r(   c                   V ^8  d   QhRR/# r   r    )r-   s   "r%   r.   UntypedStorage.__annotate__  s     $ $* $r(   c                "    V P                  4       # )zReturns 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   r3   s   &r%   r   UntypedStorage.filename  s     !!##r(   c                $   < \         SV `  ! V/ VB # )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  UntypedStorage.share_memory_  s    B w$d5f55r(   c                	$   < \         SV `  ! V/ VB # r   )r  r~   r  s   &*,r%   r~   UntypedStorage._share_fd_cpu_  s    w%t6v66r(   c                	$   < \         SV `  ! V/ VB # r   )r  r{   r  s   &*,r%   r{   #UntypedStorage._share_filename_cpu_  s    w+T<V<<r(   r    )r  r  r  r  r:   r  r   r   r   r  r  r~   r{   r  r  r  s   @r%   r   r     s    4
 * * ) ) $ $ " 6 " 6D "7 "7 "= "=r(   c                Z    \         P                  ! \        P                  ! V 4      R R7      # )F)weights_only)r^   loadr  r  )r  s   &r%   r  r    s    ::bjjm%88r(   c                    \         P                  \         P                  \         P                  \         P                  \         P
                  \         P                  \         P                  \         P                  \         P                  \         P                  \         P                  \         P                  \         P                  \         P                  \         P                  0# r   )r^   r|  r  r  r  float8_e8m0fnufloat4_e2m1fn_x2bits8bits16bits1x8bits2x4bits4x2	complex32uint16uint32uint64r    r(   r%   _new_dtypesr    s    
 	 r(   c                 H   / \         P                  R b\         P                  Rb\         P                  Rb\         P                  Rb\         P
                  Rb\         P                  Rb\         P                  Rb\         P                  Rb\         P                  Rb\         P                  R	b\         P                  R
b\         P                  Rb\         P                  Rb\         P                  Rb\         P                  Rb\         P                   Rb\         P"                  Rb# )DoubleStorageFloatStorageHalfStorageLongStorage
IntStorageShortStorageCharStorageByteStorageBoolStorageBFloat16StorageComplexDoubleStorageComplexFloatStorageQInt8StorageQInt32StorageQUInt8StorageQUInt4x2StorageQUInt2x4Storage)r^   rF  rK  rP  rU  rY  int16ra  r;  rj  rn  rr  rw  qint8qint32quint8quint4x2quint2x4r    r(   r%   _dtype_to_storage_type_mapr
  1  s   o^ 	

M 	

M	
 			< 	^ 	

M 	] 	

M 	) 	- 	+ 	^ 	o 	o  	)!" 	)# r(   c                 h    \        4       P                  4        U Uu/ uF  w  rWbK	  	  pp pV# u upp i r   )r
  items)r  val	dtype_maps      r%   _storage_type_to_dtype_mapr  M  s4    *D*F*L*L*NO*Nhc*NIO Ps   .c           
     z   V\         P                  \         P                  \         P                  \         P                  \         P
                  39   d   \         P                  \         P                  \         P                  \         P                  \         P                  \         P                  \         P                  \         P                  \         P
                  \         P                  /p\         P                  ! WV,          VR 7      pM\         P                  ! WVR 7      pVP                  4       P                  # )r7  )r^   r  r  r	  r  r  r;  int32ra  r:  r=  _untyped_storage)sequencerT   r   interpret_dtypes
tmp_tensors   &&&  r%   _get_storage_from_sequencer  S  s      LL%++NNEKKNNEKKLL%++KK
 \\U3F


 \\(G
$$&777r(   c                z    \         '       d!   \        V \        \        P                  34      # \        V \        4      # r   )	HAS_NUMPYr8  rY  npinteger)xs   &r%   _isintr  l  s*    y!c2::.//!S!!r(   c                     \         # r   )"_always_warn_typed_storage_removalr    r(   r%   &_get_always_warn_typed_storage_removalr  v  s    --r(   c                x    \        V \        4      '       g"   \        R \        V 4      P                   24      hV sR# )zalways_warn must be bool, got N)r8  rj  r  rW   r  r  )always_warns   &r%   &_set_always_warn_typed_storage_removalr"  z  s:    k4((,T+->-G-G,HI
 	
 *5&r(   c                    R  p\        4       '       g   V! 4       '       d<   Rp\        P                  ! V\        V ^,           R7       R\        P
                  R&   R# R# )c                 j    \        \        R 4      '       g   R# \        P                  R ,          '       * # )
has_warnedT)hasattr_warn_typed_storage_removal__dict__r    r(   r%   is_first_time2_warn_typed_storage_removal.<locals>.is_first_time  s'    2LA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())
stacklevelTr%  N)r  warningswarnUserWarningr'  r(  )r+  r)  messages   &  r%   r'  r'    sQ    J .//=??Q 	 	g{zA~F=A#,,\: 4Cr(   c                 ,    R \         P                  R&   R# )Fr%  N)r'  r(  r    r(   r%   !_reset_warn_typed_storage_removalr1    s    9>((6r(   c                   V ^8  d   QhRR/# )r+   moduler   r    )r-   s   "r%   r.   r.     s      C r(   c                    V P                  R ^4      R,          pVR\        P                  P                  4       R39   d   V# R# ).r[   re   r/  )rsplitr^   r  r  )r3  	last_parts   & r%   _get_device_from_moduler9    s<    c1%b)IVUXXCCEuMMr(   c                    a  ] tR tRt$ RtR]R&   RtR]R&   R]R	&   ]R
 4       t]R R l4       t	R t
RRR	RRRRR/V 3R lltRRR	RRRRR/R lt]R 4       t]R 4       tR tR R ltR tRqR ltR tR tR tR tRrR R lltR  tR! tRsR" R# lltRsR$ R% lltRsR& R' lltR(R/R) R* lltR+ tR, tR- R. lt R/ t!R0 t"R1 t#R2 t$R3 t%R4 t&V 3R5 lt'R6 t(R7 t)R8 t*RtR9 R: llt+RtR; R< llt,R= t-R> t.RR/R? lt/]R@ 4       t0]RA 4       t1RB t2RC t3RD t4RE t5RF t6RG t7RH t8RI t9RJ t:RK t;]<RL 4       t=RM t>]<RN 4       t?]<R	RRR/RO l4       t@RP tARQ tBRR tCRS tDRT tERU tFRV tGRW tHRX tIRY tJRZ tKR[ tLR\ tMR] tNR^ tOR_ tPR` tQ]<Ra 4       tR]<Rb 4       tSRc tTRd tURe tVRf tWRg tXRh tY]<Ri 4       tZRj t[Rk t\]<RR/Rl l4       t]Rm t^Rn t_Ro t`RptaV ;tb# )ur   i  Fr   r   Nr   r   torch.dtyperT   c                	    V P                   # r   )rT   r3   s   &r%   _dtypeTypedStorage._dtype  s    zzr(   c                   V ^8  d   QhRR/# r   r    )r-   s   "r%   r.   TypedStorage.__annotate__  s     . .* .r(   c                .    V P                   P                  # )zReturns 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   r3   s   &r%   r   TypedStorage.filename  s     $$---r(   c                	n    \        4        V P                  \        ^ V P                  4       4      V4       V # )r   )r'  _setitemslice_size)r"   values   &&r%   fill_TypedStorage.fill_  s(    #%eAtzz|,e4r(   wrap_storager   	_internalc          	     	\  < V'       g   \        4        V \        P                  P                  8X  d   \	        R 4      hV \
        8X  d   \        SV `  V 4      # V  R2pVe   \	        VR,           4      hVe   \	        VR,           4      hVf   \        V4      ^8  d   \	        VR,           4      h\        V4      ^8X  do   \        V^ ,          4      '       gW   \        V^ ,          \        P                  P                  4      '       g&   \        VR\        V^ ,          4       2,           4      h\        VRV P                   R\#        V P$                  4      RR	/ # \        V4      ^ 8w  d   \	        VR
,           4      h\        V\        P&                  4      '       g   \        VR\        V4       2,           4      h\#        V P$                  4      pVP(                  P                  V8w  d-   \	        VRV RVP(                  P                   2,           4      h\        VRVRV P*                  RR	/ # )z8Only 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 specified
Too many positional arguments
Argument type not recognized: rT   r   rK  TB
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 rJ  )r'  r^   r?  _LegacyStorageRuntimeErrorr   r  __new__r   r  r8  collectionsabcSequencer9  rW   r=  r9  r  r   r   rT   )	r   rJ  rT   r   rK  r#   arg_error_msg
cls_devicer"  s	   &$$$$*  r%   rS  TypedStorage.__new__  sM    ')%--...J  ,7?3'' % 6 6  !"!$UU   "!$TT  #t9q=&%(II 
 IN"47OO&tAw0H0HII#%<T$q']OLM 
 $** 33>>B #	  t9>&%))  ",0D0DEE#%VW[\hWiVjkl 
 5S^^D
&&++z9&%?
|$\%8%8%=%=$>@@  $!- )) #	 r(   c               	   V'       g   \        4        R pVe   \        V4      ^ 8w  d   \        VR,           4      hVf   \        VR,           4      h\        V\        P
                  4      '       g   \        VR\        V4       2,           4      hVe   \        VR,           4      hW n        \        V\        P                  4      '       g   \        VR\        V4       2,           4      hW0n	        R# Vf   \        P                  ! 4       MTV n        \        P                  ! Vf   RMT4      pV P
                  \        P                  \        P                  \        P                  \        P                  \        P                   39   d   VP                  R8X  d   \        R	4      h\        V4      ^ 8X  d   \        P                  ! VR
7      V n	        R# \        V4      ^8X  d   \#        V^ ,          4      '       dE   \        P                  ! \%        V^ ,          4      V P'                  4       ,          VR
7      V n	        R# \        V^ ,          \(        P*                  P,                  4      '       d&   \/        V^ ,          V P
                  V4      V n	        R# \        VR\        V^ ,          4       2,           4      h\        VR,           4      h)a1  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)NrO  z#
Argument 'dtype' must be specifiedz+
Argument 'dtype' must be torch.dtype, not zG
Argument 'device' should not be specified when 'wrap_storage' is givenrP  r/  r[   /Cannot create CUDA storage with quantized dtyper&  rN  rM  )r'  r   rR  r8  r^   rT   r9  rW   r   r  get_default_dtyper   r  r  r	  r  r  r  rY  r  rT  rU  rV  r  )r"   r   rT   rJ  rK  r#   rW  s   &$$$$* r%   r&   TypedStorage.__init__  s^    ')E 	 #4yA~"!%%  }"!$JJ  eU[[11!DT%[MRS 
 !"!`a 
 JlE,@,@AA!RSWXdSeRfgh 
 %1! 7<m002DJ\\6>%vFFzz  ;;&(&I  4yA~(-(<(<F(K%Ta$q'??,1,@,@DGt'9'9';;F-D)  Q)A)ABB,FQV-D) $%<T$q']OLM  #=3T#TUUr(   c                	\    \        4        V P                  P                  P                  R 8H  # r  r'  r  r   rW   r3   s   &r%   r   TypedStorage.is_cudap  s%    #%$$++00F::r(   c                	\    \        4        V P                  P                  P                  R 8H  # r  r_  r3   s   &r%   r   TypedStorage.is_hpuu  s%    #%$$++00E99r(   c                .    \        4        V P                  # )z2Return the internal :class:`torch.UntypedStorage`.)r'  r  r3   s   &r%   r  TypedStorage.untypedz  s    #%$$$r(   c                   V ^8  d   QhRR/# r   r    )r-   s   "r%   r.   r@    s     < <t <r(   c           	     	   \        V4      \        P                  Jd"   \        R \        V4      P                   24      h\        V 4      \
        J d&   \        \        \        WP                  RR7      4      # \        V 4      ! VR7      # )zexpected UntypedStorage, got TrJ  rT   rK  rJ  )	rW   r^   r   r  r  r   r   r   rT   )r"   r  s   &&r%   _new_wrapped_storage!TypedStorage._new_wrapped_storage  sx     (<(<< /_0E0N0N/OP  :%!0

d  :?;;r(   c                	6    \        4        V P                  4       # r   r'  rF  r3   s   &r%   r4   TypedStorage.__len__      #%zz|r(   c                	D   Vf   V'       d   V P                  4       # ^ # \        V4      \        Jd$   \        R\        V 4       R\        V4       24      hV'       dh   WP                  4       8  g   WP                  4       ) 8  d    \	        RV RV P                  4        24      hV^ 8  d   V# WP                  4       ,          # WP                  4       8  g   WP                  4       ) 8  d    \	        RV RV P                  4        24      hWP                  4       ,          # )Ncan't index a  with zindex z" out of range for storage of size )rF  rW   rY  r9  
IndexErrorrQ   )r"   r9   is_stops   &&&r%   _maybe_wrap_indexTypedStorage._maybe_wrap_index  s    ;zz|# Cy#.dF49+ NOO**,&C::<-,?$ %G		}U  7J--::<'SJJL=-@$ %G		}U  ZZ\))r(   c                	8    \        4        V P                  W4      # r   )r'  rD  )r"   r9   rG  s   &&&r%   r=   TypedStorage.__setitem__  s    #%}}S((r(   c           
     	2   \        V\        \        34      '       g$   \        R \	        V 4       R\	        V4       24      h\
        P                  ! V4      '       d   \        R\	        V4       24      hV P                  \
        P                  \
        P                  \
        P                  \
        P                  \
        P                  39   d   \
        P                  \
        P                  \
        P                  \
        P                  \
        P                  \
        P                  \
        P                  \
        P                  \
        P                  \
        P                  /pW0P                  ,          p\
        P                   ! . W@P"                  P$                  R7      pVP'                  \)        V P"                  VRR7      4       MF\
        P                   ! . V P                  V P"                  P$                  R7      P'                  V 4      pW%V&   R# )rp  rq  z cannot set item with value type r7  Trg  N)r8  rY  rE  rR  rW   r^   
is_storagerT   r  r  r	  r  r  r;  r  ra  r:  r  r   r<  r   )r"   r9   rG  r  	tmp_dtyper  s   &&&   r%   rD  TypedStorage._setitem  sg   #U|,,T
|6$s)MNNE""!A$u+OPP::LLNNNNLLKK
 
 ekkekkUZZ  )4I),A,A,H,HJ OO!%!6!6iSW $**T-B-B-I-Id4j   3r(   c                	8    \        4        V P                  V4      # r   )r'  _getitemr8   s   &&r%   r:   TypedStorage.__getitem__  s    #%}}S!!r(   c           
     	   V P                   P                  P                  R 8X  d   \        R4      h\	        V\
        4      '       d   \        R4      h\	        V\        4      '       g$   \        R\        V 4       R\        V4       24      hV P                  \        P                  \        P                  \        P                  \        P                  \        P                  39   d   \        P                  \        P                  \        P                  \        P                  \        P                  \        P                  \        P                  \        P                   \        P                  \        P"                  /p\%        V P                   W P                  ,          RR7      P'                  V4      # T P)                  V4      p^ RIHp V! 4       ;_uu_ 4        \        P.                  ! . V P                  V P                   P                  R7      P1                  V 4      pWS,          P3                  4       uuR	R	R	4       #   + '       g   i     R	# ; i)
r   r  z7slices are only supported in UntypedStorage.__getitem__rp  rq  Trg  )unset_fake_temporarilyr7  N)r  r   rW   r2   r8  rE  rR  rY  rT   r^   r  r  r	  r  r  r;  r  ra  r   r}  rt  torch._subclasses.fake_tensorr  r:  r<  item)r"   r9   r  idx_wrappedr  r  s   &&    r%   r}  TypedStorage._getitem  s     '',,6%&LMM c5!!I  C%%T
|6$s)MNN::LLNNNNLLKK
 
 ekkekkUZZ   !22&zz2 hsm	 ,,S1H#%%$**T-B-B-I-Id4j  *//1	 &%%%s   AII	c                    V ^8  d   QhRRRR/# )r+   r@   r   rA   zbool | Noner    )r-   s   "r%   r.   r@    s      A [ r(   c                	    \        4        \        V\        4      '       d)   V P                  P	                  VP                  V4       V # V P                  P	                  W4       V # r   )r'  r8  r   r  rD   rC   s   &&&r%   rD   TypedStorage.copy_  sS    #%fl++!!''(?(?N  !!''=r(   c                	6    \        4        V P                  4       # r   )r'  _nbytesr3   s   &r%   rM   TypedStorage.nbytes  s    #%||~r(   c                	6    V P                   P                  4       # r   )r  rM   r3   s   &r%   r  TypedStorage._nbytes  s    $$++--r(   c               $    V ^8  d   QhRRRRRR/# )r+   rT   rU   rA   rj  r,   z!_StorageBase | TypedStorage | strr    )r-   s   "r%   r.   r@    s-     C CC C 
+	Cr(   c                	$   \        4        Vfi   V P                  4       pVe%   VP                  R,           VP                  ,           # RP	                  V P                  \        V 4      P                  .4      # V P                  P                  W4      # )Nr5  )r'  _get_legacy_storage_classr  r  r   rW   r  )r"   rT   rA   legacy_classs   &&& r%   rW   TypedStorage.type  sz    
 	$%=99;L'#..4|7L7LLL88T__d4j.A.ABCC ((--eBBr(   c                   V ^8  d   QhRR/# r   r    )r-   s   "r%   r.   r@  %  s     7 7t 7r(   c                	<   \        4        V P                  \        P                  \        P                  \        P
                  \        P                  \        P                  39   d   \        R 4      hV P                  P                  W4      pV P                  V4      # )r[  )r'  rT   r^   r  r  r	  r  r  rR  r  r[   ri  )r"   r   rA   cuda_storages   &&& r%   r[   TypedStorage.cuda%  sq    #%::LLNNNNLLKK
 
 PQQ,,11&G((66r(   c                   V ^8  d   QhRR/# r   r    )r-   s   "r%   r.   r@  2  s     6 6d 6r(   c                	<   \        4        V P                  \        P                  \        P                  \        P
                  \        P                  \        P                  39   d   \        R 4      hV P                  P                  W4      pV P                  V4      # )z.Cannot create HPU storage with quantized dtype)r'  rT   r^   r  r  r	  r  r  rR  r  re   ri  )r"   r   rA   hpu_storages   &&& r%   re   TypedStorage.hpu2  sq    #%::LLNNNNLLKK
 
 OPP++//E((55r(   rA   c               $    V ^8  d   QhRRRRRR/# )r+   r   r   rA   rj  r,   r   r    )r-   s   "r%   r.   r@  ?  s!     5 5N 5$ 54 5r(   c               	   \        4        \        V\        P                  4      '       g   \        P                  ! V4      pV P                  \        P
                  \        P                  \        P                  \        P                  \        P                  39   d(   \        R VP                  P                  4        R24      hV P                  P                  WR7      pV P                  V4      # )zCannot create z storage with quantized dtyper\   )r'  r8  r^   r   rT   r  r  r	  r  r  rR  rW   upperr  r_   ri  )r"   r   rA   
to_storages   &$$ r%   r_   TypedStorage.to?  s    #%&%,,//\\&)F::LLNNNNLLKK
 
  !2!2!4 55RS  **--V-W
((44r(   c                	6    \        4        V P                  4       # r   )r'  r  r3   s   &r%   ri   TypedStorage.element_sizeP  s    #%!!##r(   c                	T    \         P                  P                  V P                  4      # r   )r^   r  r  rT   r3   s   &r%   r  TypedStorage._element_sizeU  s    ||))$**55r(   c                   V ^8  d   QhRR/# r*   r    )r-   s   "r%   r.   r@  X  s     2 2D 2r(   c                	J    \        4        V P                  P                  4       # r   )r'  r  rn   r3   s   &r%   rn   TypedStorage.get_deviceX  s    #%$$//11r(   c           
     	r  a  \        4        R \        P                  ! S 4       RS P                   RS P                   R\        S 4       R2	pS P                  P                  R8X  d
   RV,           # RRP                  V 3R	 l\        S P                  4       4       4       4      ,           pVR
,           V,           # )r   z(dtype=z	, device=r   r   r   r   r   r   c              3  H   <"   T F  p\        SV,          4      x  K  	  R # 5ir   r   r   s   & r%   r   'TypedStorage.__str__.<locals>.<genexpr>e  s     'Q>PDG>Pr   r   )
r'  r^   r   rT   r   r   rW   r   r   rQ   r   s   f  r%   __str__TypedStorage.__str__\  s    #%t$%WTZZL 9kk]*SYKq: 	 ;;v%X%%UZZ'QeDIIK>P'QQQHd?X--r(   c                	,    \        4        \        V 4      # r   )r'  r   r3   s   &r%   r   TypedStorage.__repr__h  s    #%4yr(   c                	p   a  \        4        \        V 3R  l\        S P                  4       4       4       4      # )c              3  6   <"   T F  pSV,          x  K  	  R # 5ir   r    r   s   & r%   r   (TypedStorage.__iter__.<locals>.<genexpr>n  r  r  )r'  r  r   rQ   r3   s   fr%   r  TypedStorage.__iter__l  s%    #%8U499;%7888r(   c                	t    \        4        V P                  \        P                  ! V P                  4      4      # r   )r'  ri  copyr  r3   s   &r%   r  TypedStorage.__copy__p  s(    #%((43H3H)IJJr(   c                	8    \        4        V P                  V4      # r   )r'  	_deepcopyr"   r  s   &&r%   r  TypedStorage.__deepcopy__t  s    #%~~d##r(   c                	b    V P                  \        P                  ! V P                  V4      4      # r   )ri  r  deepcopyr  r  s   &&r%   r  TypedStorage._deepcopyy  s$    ((t7L7Ld)STTr(   c                	^   < \        4        \        SV `	  4       V P                  4       ,           # r   )r'  r  r   rM   r!  s   &r%   r   TypedStorage.__sizeof__|  s"    #%w!#dkkm33r(   c                h    \        4        V P                  V P                  P                  4       4      # )r%  )r'  ri  r  r  r3   s   &r%   r  TypedStorage.clone  s(    #%(()>)>)D)D)FGGr(   c                ,    \        4        \        V 4      # r)  )r'  r*  r3   s   &r%   r+  TypedStorage.tolist  s    #%Dzr(   c                h    \        4        V P                  V P                  P                  4       4      # )r.  )r'  ri  r  r/  r3   s   &r%   r/  TypedStorage.cpu  s(    #%(()>)>)B)B)DEEr(   c                   V ^8  d   QhRR/# r  r    )r-   s   "r%   r.   r@    s     7 7 2 7r(   c                L    \        4        V P                  P                  V4      # )a  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  TypedStorage.is_pinned  s!     	$%$$..v66r(   c                   V ^8  d   QhRR/# r  r    )r-   s   "r%   r.   r@    s     
 
!3 
r(   c                l    \        4        V P                  V P                  P                  VR7      4      # )a  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.
r&  )r'  ri  r  r  r  s   &&r%   r  TypedStorage.pin_memory  s4     	$%((!!,,F,;
 	
r(   c                6    \        4        V P                  4       # )r  )r'  _share_memory_r3   s   &r%   r  TypedStorage.share_memory_  s    #%""$$r(   c                	:    V P                   P                  4        V # r   )r  r  r3   s   &r%   r  TypedStorage._share_memory_  s    ++-r(   c                   Vf   Rp\         P                  ! V4      p\         P                  P                  WP	                  4       ,          VR7      p\        W0P                  RR7      # )r  r/  r&  Trg  )r^   r   r   r  r  r   rT   )r"   rQ   r   r  s   &&$ r%   r  TypedStorage._new_shared  s^    >Ff%..::%%'' ; 
 (

d
 	
r(   c                	.    V P                   P                  # r   )r  r   r3   s   &r%   r   TypedStorage._cdata  s    $$+++r(   c                	B    \        4        V P                  P                  # r   )r'  r  r   r3   s   &r%   r   TypedStorage.device  s    #%$$+++r(   c                	6    \        4        V P                  4       # r   rl  r3   s   &r%   rQ   TypedStorage.size  rn  r(   c                	`    V P                   P                  4       V P                  4       ,          # r   )r  rM   r  r3   s   &r%   rF  TypedStorage._size  s'     $$++-1C1C1EEEr(   c                	6    \        4        V P                  4       # r   )r'  _pickle_storage_typer3   s   &r%   pickle_storage_type TypedStorage.pickle_storage_type  s    #%((**r(   c                	     \        4       V P                  ,          #   \         d    p\        R T P                   R24      ThRp?ii ; i)zdtype z is not recognizedN)r
  rT   KeyError)r"   es   & r%   r  !TypedStorage._pickle_storage_type  sG    	K-/

;; 	KVDJJ</ABCJ	Ks    AAAc                	    \         P                  ! 4       p\        P                  ! WR R7       \        VP                  4       33# r  r  r  s   & r%   r  TypedStorage.__reduce__  r  r(   c                	6    \        4        V P                  4       # r   )r'  	_data_ptrr3   s   &r%   rr   TypedStorage.data_ptr  s    #%~~r(   c                	6    V P                   P                  4       # r   )r  rr   r3   s   &r%   r  TypedStorage._data_ptr  s    $$--//r(   c                	J    \        4        V P                  P                  4       # r   )r'  r  rx   r3   s   &r%   rx   TypedStorage.resizable  s    #%$$..00r(   c                	<    \        4        V P                  V4       R # r   )r'  _resize_r   s   &&r%   r   TypedStorage.resize_  s    #%dr(   c                	d    V P                   P                  WP                  4       ,          4       R # r   )r  r   r  r   s   &&r%   r  TypedStorage._resize_  s"    %%d-?-?-A&ABr(   c                	.    \         P                  ! V/ VB # r   )r   r   r   s   &*,r%   r   TypedStorage._free_weak_ref  s    ,,d=f==r(   c                	:    V P                   P                  ! V/ VB # r   )r  r   r!   s   &*,r%   r   TypedStorage._weak_ref  s    $$..???r(   c                	:    \        4        V P                  ! V/ VB # r   )r'  _from_bufferr   s   &*,r%   r   TypedStorage.from_buffer  s    #%000r(   c               	   V \         8X  d   Vf   \        P                  ! 4       MTp\        P                  ! Vf   RMT4      pVP                  R8w  d   \        RVP                   24      h\        P                  P                  ! VRV/VB pM\Vf   \        V4      ^8X  d   \        R4      hVe   \        R4      hV P                  p\        P                  P                  ! VRV/VB p\        WQRR7      # )Nr/  z3TypedStorage.from_buffer: Not available for device rT   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_bufferTrg  )
r   r^   r\  r   rW   rR  r   r   r   r=  )r   rT   r   r#   r$   r  s   &$$*, r%   r  TypedStorage._from_buffer  s   ,16E++-EE\\6>%vFF{{e#"I&++W  5:4H4H4T4T5"5&,5O
  CIN"N  !"N 
 JJE#22>>"&,O QUVVr(   c                	   \        V\        P                  4      '       g   \        R \	        V4       24      h\        P
                  ! . V P                  V P                  R7      P                  V 4      P                  V4      P                  4       pVP                  4       V P                  4       8X  d   VP                  4       pV# r6  )r8  r^   rT   r9  rW   r:  r   r<  r_   r=  rr   r  r>  s   && r%   r	   TypedStorage._to$  s    %--HeVWWLL4::dkkBT$ZRY^	 	 0mmoGr(   c                T    \        4        V P                  \        P                  4      # rE  )r'  r	   r^   rF  r3   s   &r%   rF  TypedStorage.double1      #%xx%%r(   c                T    \        4        V P                  \        P                  4      # rJ  )r'  r	   r^   rK  r3   s   &r%   rK  TypedStorage.float6      #%xx$$r(   c                T    \        4        V P                  \        P                  4      # rO  )r'  r	   r^   rP  r3   s   &r%   rP  TypedStorage.half;      #%xx

##r(   c                T    \        4        V P                  \        P                  4      # rT  )r'  r	   r^   rU  r3   s   &r%   rU  TypedStorage.long@  r  r(   c                T    \        4        V P                  \        P                  4      # rX  )r'  r	   r^   rY  r3   s   &r%   rY  TypedStorage.intE  s    #%xx		""r(   c                T    \        4        V P                  \        P                  4      # r\  )r'  r	   r^   r]  r3   s   &r%   r]  TypedStorage.shortJ  r  r(   c                T    \        4        V P                  \        P                  4      # r`  )r'  r	   r^   ra  r3   s   &r%   rb  TypedStorage.charO  r  r(   c                T    \        4        V P                  \        P                  4      # re  )r'  r	   r^   r;  r3   s   &r%   rf  TypedStorage.byteT  r  r(   c                T    \        4        V P                  \        P                  4      # ri  )r'  r	   r^   rj  r3   s   &r%   rj  TypedStorage.boolY  r  r(   c                T    \        4        V P                  \        P                  4      # rm  )r'  r	   r^   rn  r3   s   &r%   rn  TypedStorage.bfloat16^  s    #%xx''r(   c                T    \        4        V P                  \        P                  4      # rq  )r'  r	   r^   rr  r3   s   &r%   rs  TypedStorage.complex_doublec  s    #%xx&&r(   c                T    \        4        V P                  \        P                  4      # rv  )r'  r	   r^   rw  r3   s   &r%   rx  TypedStorage.complex_floath  r  r(   c                T    \        4        V P                  \        P                  4      # r{  )r'  r	   r^   r|  r3   s   &r%   r|  TypedStorage.float8_e5m2m  s    #%xx))**r(   c                T    \        4        V P                  \        P                  4      # r  )r'  r	   r^   r  r3   s   &r%   r  TypedStorage.float8_e4m3fnr  s    #%xx++,,r(   c                T    \        4        V P                  \        P                  4      # r  )r'  r	   r^   r  r3   s   &r%   r  TypedStorage.float8_e5m2fnuzw      #%xx--..r(   c                T    \        4        V P                  \        P                  4      # r  )r'  r	   r^   r  r3   s   &r%   r  TypedStorage.float8_e4m3fnuz|  r  r(   c                    \        4        V \        8X  d   \        R4      h\        P	                  WV\
        P                  P                  V P                  4      ,          4      pV ! VR7      pV# )aJ  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 classesrh  )	r'  r   rR  r   r   r^   r  r  rT   )r   r   r   rQ   r  r?  s   &&&&  r%   r   TypedStorage.from_file  s\    ( 	$%,PQQ(22dU\\%?%?		%JJ
 ?3r(   c                	.    \         P                  ! V/ VB # r   )r   r   r   s   &*,r%   r   TypedStorage._expired  s    &&777r(   c                	:    V P                   P                  ! V/ VB # r   )r  r   r!   s   &*,r%   r   TypedStorage._write_file  s    $$00$A&AAr(   c                	:    V P                   P                  ! V/ VB # r   )r  r   r!   s   &*,r%   r   TypedStorage._set_from_file      $$33TDVDDr(   c                	:    V P                   P                  ! V/ VB # r   )r  r   r!   s   &*,r%   r   TypedStorage._set_cdata  s    $$//@@@r(   c                	:    V P                   P                  ! V/ VB # r   )r  r   r!   s   &*,r%   r   TypedStorage._share_cuda_  s    $$114B6BBr(   c                	6    \        4        V P                  4       # r   )r'  
_is_sharedr3   s   &r%   r   TypedStorage.is_shared  s    #%  r(   c                	6    V P                   P                  4       # r   )r  r   r3   s   &r%   r+  TypedStorage._is_shared  s    $$..00r(   c                	B    \         P                  P                  ! V/ VB # r   )r^   r   r   r   s   &*,r%   r   TypedStorage._new_shared_cuda  s    ##44dEfEEr(   c                	r    V P                   P                  ! V/ VB w  pppW4WPP                  4       ,          3# r   )r  r{   r  )r"   r#   r$   manager_handlestorage_handlerQ   s   &*,   r%   r{   !TypedStorage._share_filename_cpu_  sB    
 !!66GG		
t7I7I7K/KKKr(   c                	:    V P                   P                  4        V # r   )r  r   r3   s   &r%   r   TypedStorage._shared_decref  s    ,,.r(   c               	B    \         P                  P                  ! V/ VB # r   r^   r   r   r   s   &$*,r%   r   !TypedStorage._release_ipc_counter      ##==tNvNNr(   c                	:    V P                   P                  ! V/ VB # r   )r  r   r!   s   &*,r%   r   TypedStorage._shared_incref  r%  r(   c                	n    V P                   P                  ! V/ VB w  r4W4V P                  4       ,          3# r   )r  r~   r  )r"   r#   r$   fdrQ   s   &*,  r%   r~   TypedStorage._share_fd_cpu_  s6    ((77HH4--////r(   c                	   V P                   \        4       9  d   R # \        4       V P                   ,          pV P                  P                  RRR\        P
                  P                  4       39  d   R # V P                  P                  R8X  d   \        M#\        \        V P                  P                  4      p \        W!4      #   \         d     R # i ; i)Nr/  r[   re   )	rT   r
  r   rW   r^   r  r  getattrAttributeError)r"   storage_namer3  s   &  r%   r  &TypedStorage._get_legacy_storage_class  s    ::79913DJJ?;;HH224	$
 
  [[%%.EGE4;;CSCS4T 		600 		s   :
C CC)r  rT   Fr   r  r  )cr  r  r  r  r   r  r   r  r=  r   rH  rS  r&   r   r   r  ri  r4   rt  r=   rD  r:   r}  rD   rM   r  rW   r[   re   r_   ri   r  rn   r  r   r  r  r  r  r   r  r+  r/  r  r  r  r  r  r   r   rQ   rF  r  r  r  rr   r  rx   r   r  r  r   r   r   r  r	   rF  rK  rP  rU  rY  r]  rb  rf  rj  rn  rs  rx  r|  r  r  r  r   r   r   r   r   r   r   r+  r   r{   r   r   r   r~   r  r  r  r  s   @r%   r   r     s:   Iu(,L%,  . .

Z Z 	Z
 Z ZxYV YV 	YV
 YV YVv ; ; : :%
< *4)! F"*2X
.C"765 5"$
62
.9K$
U4H

F
7
%

$ 

 , , , ,
F
+
K3
 
01
C > >@ 1 1 Wt WD W W>&
%
$
$
#
%
$
%
$
(
'
&
+
-
/
/
  8 8 8BEAC!
1 F FL O O OE0 r(   c                  (    ] tR tRt$ R]R&   R tRtR# )_LegacyStorageMetai  r;  rT   c                	    \        V4      \        J dO   \        V P                  4      pW!P                  P                   8H  ;'       d    V P
                  VP
                  8H  # R # rE  )rW   r   r9  r  r   rT   )r   instancerX  s   && r%   __instancecheck__$_LegacyStorageMeta.__instancecheck__  sP    >\)0@J//"6"66  		X^^+ r(   r    N)r  r  r  r  r  rJ  r  r    r(   r%   rG  rG    s    r(   rG  c                  F    ] tR tRt]R 4       t]R 4       t]R 4       tRtR# )rQ  i  c                    \         P                  P                  W! 4       P                  4       ,          4      pV ! VR7      # )r  rh  )r^   r   r  r  )r   rQ   r  s   && r%   r  _LegacyStorage._new_shared  s5      ..::4#%BUBUBW;WX00r(   c                	B    \         P                  P                  ! V/ VB # r   r8  r   s   &*,r%   r   #_LegacyStorage._release_ipc_counter  r:  r(   c                	    V\         P                  P                  V P                  4      ,          pV ! \         P                  P                  WV4      R 7      # )rh  )r^   r  r  rT   r   r   )r   r   r   rQ   
bytes_sizes   &&&& r%   _new_shared_filename#_LegacyStorage._new_shared_filename  sE    ELL66syyAA
--FFj
 	
r(   r    N)	r  r  r  r  r  r  r   rS  r  r    r(   r%   rQ  rQ    s>    1 1
 O O 
 
r(   rQ  )	metaclassc                   V ^8  d   QhRR/# )r+   r  r   r    )r-   s   "r%   r.   r.     s      S r(   c                l     \        4       V ,          #   \         d   p\        R T  R24      ThRp?ii ; i)zpickle storage type "z" is not recognizedN)r  r  )r  r  s   & r%   #_get_dtype_from_pickle_storage_typerX    sE    )+,?@@ #$7#88KL
	s    3.3)r+   )?__conditional_annotations__
__future__r   rT  r  r  r  r  r,  typingr   r   r   r   typing_extensionsr   r^   torch._utilsr	   r
   torch.typesr   r   r   torch._prims_commonr   __all__numpyr  r  ModuleNotFoundErrorLockr  r   r  r   r   r  r  StorageBaser   r  cacher  r
  r  r  r  r  r  r"  r'  r1  r9  r   __doc__rW   r[   re   r_   rG  rQ  rX  )rY  s   @r%   <module>rg     s   # "    	   4 4 "  # , , 2 +
,I ^^% 02 - 2C45@" @"F$N@=UXX))< @=F9  ,  6  
82" &+ ".5B(?C CL "MM   (--55   '++33   ++ 	 	
\-? 
*e/  I	Bs   F2 2G G