§
    ÙwŠiß  ã                   ó–   — d Z ddlmZ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gZdS )zKThis package adds support for device memory management implemented in MTIA.é    )ÚAnyÚDictÚOptionalNé   )Ú	_device_tÚis_initialized)Ú_get_device_indexÚdeviceÚreturnc                 ó~   — t          ¦   «         si S t          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    úa/root/.openclaw/workspace/chatterbox_venv_py311/lib/python3.11/site-packages/torch/mtia/memory.pyÚmemory_statsr      s;   € õ ÑÔð Øˆ	ÝŒ8×%Ò%Õ&7¸ÈÐ&NÑ&NÔ&NÑOÔOÐOó    c                 óJ   — t          | ¬¦  «                             dd¦  «        S )a)  Return the maximum memory allocated in bytes for a given device.

    Args:
        device (torch.device or int, optional): selected device. Returns
            statistic for the current device, given by :func:`~torch.mtia.current_device`,
            if :attr:`device` is ``None`` (default).
    r   zallocated_bytes.all.peakr   )r   Úgetr   s    r   Úmax_memory_allocatedr      s&   € õ ˜vÐ&Ñ&Ô&×*Ò*Ð+EÀqÑIÔIÐIr   r   r   )N)Ú__doc__Útypingr   r   r   r   Ú r   r   Ú_utilsr	   Ústrr   Úintr   Ú__all__© r   r   ú<module>r       sà   ðð SÐ Rà &Ð &Ð &Ð &Ð &Ð &Ð &Ð &Ð &Ð &à €€€à 'Ð 'Ð 'Ð 'Ð 'Ð 'Ð 'Ð 'Ø %Ð %Ð %Ð %Ð %Ð %ð
Pð 
P˜ )Ô,ð 
P¸¸SÀ#¸X¼ð 
Pð 
Pð 
Pð 
Pð	Jð 	J ¨)Ô!4ð 	JÀð 	Jð 	Jð 	Jð 	Jð Øð€€€r   