o
    闦i                     @   s   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	d
Zddee defd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                 C   s   t  si S tjt| d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	    r   O/home/ubuntu/transcripts/venv/lib/python3.10/site-packages/torch/mtia/memory.pymemory_stats   s   r   c                 C   s   t | d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   r   r   r   max_memory_allocated   s   	r   )N)__doc__typingr   r   r   r    r   r   _utilsr   strr   intr   __all__r   r   r   r   <module>   s    