Ë
    [^(hÝ  ã                   ó–   — d Z ddlmZmZ ddlZddlmZmZ ddlm	Z	 ddee   de
eef   fd	„Zddee   defd
„Zddee   ddfd„Zg d¢Zy)zKThis package adds support for device memory management implemented in MTIA.é    )ÚAnyÚOptionalNé   )Ú	_device_tÚis_initialized)Ú_get_device_indexÚdeviceÚreturnc                 ón   — t        «       si S t        j                  j                  t	        | d¬«      «      S )a  Return a dictionary of MTIA memory allocator statistics for a given device.

    Args:
        device (torch.device, str, or int, optional) selected device. Returns
            statistics for the current device, given by current_device(),
            if device is None (default).
    T©Úoptional)r   ÚtorchÚ_CÚ_mtia_memoryStatsr   ©r	   s    úO/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/torch/mtia/memory.pyÚmemory_statsr      s,   € ô ÔØˆ	Ü�8‰8×%Ñ%Ô&7¸ÈÔ&NÓOÐOó    c                 ón   — t        «       syt        | «      j                  dd«      j                  dd«      S )a  Return the maximum memory allocated in bytes for a given device.

    Args:
        device (torch.device, str, or int, optional) selected device. Returns
            statistics for the current device, given by current_device(),
            if device is None (default).
    r   ÚdramÚ
peak_bytes)r   r   Úgetr   s    r   Úmax_memory_allocatedr      s2   € ô ÔØÜ˜Ó×#Ñ# F¨AÓ.×2Ñ2°<ÀÓCÐCr   c                 ón   — t        «       syt        j                  j                  t	        | d¬«      «       y)a  Reset the peak memory stats for a given device.


    Args:
        device (torch.device, str, or int, optional) selected device. Returns
            statistics for the current device, given by current_device(),
            if device is None (default).
    NTr   )r   r   r   Ú_mtia_resetPeakMemoryStatsr   r   s    r   Úreset_peak_memory_statsr   '   s'   € ô ÔØÜ	‡H�H×'Ñ'Ô(9¸&È4Ô(PÕQr   )r   r   r   )N)Ú__doc__Útypingr   r   r   Ú r   r   Ú_utilsr   ÚdictÚstrr   Úintr   r   Ú__all__© r   r   ú<module>r&      sw   ðñ Sç  ã ç 'Ý %ñ
P˜ )Ñ,ð 
P¸¸SÀ#¸X¹ó 
Pñ
D ¨)Ñ!4ð 
DÀó 
DñR H¨YÑ$7ð RÀ4ó Rò�r   