Ë
    g^(hw  ã                   ó  — U d dl Z d dlmZ d dlmZ d dlmZ d dlZd dlm	Z	 d dl
mZmZmZmZ g Zee   ed<   e G d„ d«      «       Z e	j(                  eg«        G d	„ d
«      Ze efdededededdf
d„Z	 	 dddœdedededededefd„Zy)é    N)Ú	dataclass)ÚBufferedIOBase)ÚAny)Ú_loadÚ_saveÚDEFAULT_PROTOCOLÚMAP_LOCATIONÚ__all__c                   ó,   — e Zd ZU eed<   eed<   eed<   y)Ú_EntryÚkeyÚ
is_storageÚlengthN)Ú__name__Ú
__module__Ú__qualname__ÚstrÚ__annotations__ÚboolÚint© ó    ú^/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/torch/distributed/_serialization.pyr   r      s   … à	ƒHØÓØ„Kr   r   c                   ó¤   — e Zd Zdd„Zdedededdfd„Zdeddfd	„Z	deddfd
„Z
dedefd„Zdedefd„Zdedededej                  fd„Zdefd„Zy)Ú_PseudoZipFileÚreturnNc                 ó   — i | _         y ©N©Úrecords©Úselfs    r   Ú__init__z_PseudoZipFile.__init__   s	   € Ø68ˆ�r   r   Údatar   c                 ó&   — ||f| j                   |<   y r   r   )r"   r   r$   r   s       r   Úwrite_recordz_PseudoZipFile.write_record   s   € Ø! 6˜Nˆ�‰�SÒr   Úfc           
      ón  — g }| j                   j                  «       D ]=  \  }\  }}|j                  t        |t	        |t
        j                  «      |¬«      «       Œ? t        j                  ||t        ¬«       | j                   j                  «       D ]   \  }\  }}t	        |t        «      r|j                  |«       Œ+t	        |t        «      r!|j                  |j                  d«      «       Œ\t	        |t
        j                  «      r|j                  |ddd«       Œ‹t        dt!        |«      › �«      ‚ y )N)r   r   r   )Úprotocolúutf-8Fé   zunknown type: )r    ÚitemsÚappendr   Ú
isinstanceÚtorchÚUntypedStorageÚpickleÚdumpr   ÚbytesÚwriter   ÚencodeÚ_write_fileÚ	TypeErrorÚtype)r"   r'   Úentriesr   r$   r   s         r   Úwrite_toz_PseudoZipFile.write_to   sü   € ØˆØ#'§<¡<×#5Ñ#5Ó#7ò 	ÑˆC‘�$˜Ø�N‰NÜØÜ)¨$´×0DÑ0DÓEØ!ôõð	ô 	�‰�G˜QÔ)9Õ:à#'§<¡<×#5Ñ#5Ó#7ò 	?ÑˆC‘�$˜Ü˜$¤Ô&Ø—‘˜•Ü˜D¤#Ô&Ø—‘˜Ÿ™ GÓ,Õ-Ü˜D¤%×"6Ñ"6Ô7Ø× Ñ   E¨5°!Õ4ä .´°d³°Ð =Ó>Ð>ñ	?r   c                 ó†  — t        j                  |«      }|D ]§  }|j                  |j                  «      }|j                  rYt        j                  |t
        j                  ¬«      j                  «       }||j                  f| j                  |j                  <   Œƒ||j                  f| j                  |j                  <   Œ© y )N©Údtype)Ú_weights_only_unpicklerÚloadÚreadr   r   r/   Ú
frombufferÚuint8Úuntyped_storager    r   )r"   r'   r9   Úentryr$   Ústorages         r   Ú	read_fromz_PseudoZipFile.read_from6   s    € Ü)×.Ñ.¨qÓ1ˆàò 	?ˆEØ—6‘6˜%Ÿ,™,Ó'ˆDØ×ÒÜ×*Ñ*ØÜŸ+™+ô÷ "‘/Ó#ð ð Ø—L‘Lð+�—‘˜UŸY™YÒ'ð
 ,0°·±Ð*>�—‘˜UŸY™YÒ'ñ	?r   c                 ó   — || j                   v S r   r   ©r"   r   s     r   Ú
has_recordz_PseudoZipFile.has_recordH   s   € Ø�d—l‘lÐ"Ð"r   c                 ó&   — | j                   |   d   S )Nr   r   rH   s     r   Ú
get_recordz_PseudoZipFile.get_recordK   s   € Ø�|‰|˜CÑ  Ñ#Ð#r   Ú_lengthÚ_typec                 ól   — t        j                  | j                  |   d   t         j                  ¬«      S )Nr   r<   )r/   Útensorr    rB   )r"   r   rL   rM   s       r   Úget_storage_from_recordz&_PseudoZipFile.get_storage_from_recordN   s'   € ô �|‰|˜DŸL™L¨Ñ-¨aÑ0¼¿¹ÔDÐDr   c                  ó   — y)NÚtorchftr   r!   s    r   Úserialization_idz_PseudoZipFile.serialization_idS   s   € Ør   )r   N)r   r   r   r#   r   Úobjectr   r&   r   r:   rF   r   rI   rK   r/   ÚTensorrP   rS   r   r   r   r   r      s®   „ ó9ð+ ð +¨6ð +¸3ð +À4ó +ð?˜.ð ?¨Tó ?ð.?˜>ð ?¨dó ?ð$#˜cð # dó #ð$˜cð $ fó $ðEØðEØ!$ðEØ-0ðEà	�‰óEð
 #ô r   r   Úobjr'   Úpickle_moduleÚpickle_protocolr   c                 óZ   — t        «       }t        | |||d¬«       |j                  |«       y)a4  
    Save the object to a file-like object in a streaming fashion compatible with
    network sockets.

    This behaves similarly to :func:`torch.save` with a few notable differences:

    * A non-seekable file like object can be used when loading.
    * No forwards/backwards compatiblity is provided for the serialization
      format. This is only intended to be used with a single version of PyTorch
      with transient storage (i.e. sockets or temp files).
    * mmap is not supported

    See :func:`torch.save` for more details on specific arguments.
    F)Úzip_filerW   rX   Ú_disable_byteorder_recordN)r   r   r:   )rV   r'   rW   rX   rZ   s        r   Ú_streaming_saver\   W   s3   € ô* Ó€HÜ	ØØØ#Ø'Ø"'õð ×Ñ�aÕr   T)Úweights_onlyÚmap_locationr]   Úpickle_load_argsc                óÀ   — |r|�t        d«      ‚t        }n|€t        }d|j                  «       vrd|d<   t	        «       }|j                  | «       t        d|||dœ|¤ŽS )a  
    Load the object from a file-like object in a streaming fashion compatible with
    network sockets.

    See :func:`_streaming_save` for more details about the streaming behavior.

    See :func:`torch.load` for more details on specific arguments.
    zDCan not safely load weights when explicit pickle_module is specifiedÚencodingr*   )rZ   r^   rW   r   )ÚRuntimeErrorr>   r1   Úkeysr   rF   r   )r'   r^   rW   r]   r_   rZ   s         r   Ú_streaming_loadrd   w   s‡   € ñ  ØÐ$ÜØVóð ô 0‰àÐ Ü"ˆMàÐ)×.Ñ.Ó0Ñ0Ø'.Ð˜Ñ$äÓ€HØ×Ñ�qÔÜð ØØ!Ø#ñð ñ	ð r   )NN)r1   Údataclassesr   Úior   Útypingr   r/   Útorch._weights_only_unpicklerr>   Útorch.serializationr   r   r   r	   r
   Úlistr   r   r   Ú_add_safe_globalsr   rT   r   r\   r   rd   r   r   r   ú<module>rl      sñ   ðÜ Ý !Ý Ý ã Ý ?ß LÓ Lð €ˆˆc‰Ó ð ÷ð ó ðð *Ð × )Ñ )¨6¨(Ô 3÷<ñ <ðD  Ø+ñ	Ø	ðàðð ðð ð	ð
 
óðD "&Øð$ð
 ò$Øð$àð$ð ð$ð
 ð$ð ð$ð ô$r   