
    <Цi                         S r SSKJrJrJr  SSKrSSKJrJr  SSK	J
r
  SS\\   S\\\4   4S	 jjrSS\\   S\4S
 jjrSS/rg)zKThis package adds support for device memory management implemented in MTIA.    )AnyDictOptionalN   )	_device_tis_initialized)_get_device_indexdevicereturnc                 r    [        5       (       d  0 $ [        R                  R                  [	        U SS95      $ )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    P/var/www/html/ai-image-ml/venv/lib/python3.13/site-packages/torch/mtia/memory.pymemory_statsr      s/     	88%%&7&NOO    c                 4    [        U S9R                  SS5      $ )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&**+EqIIr   r   r   )N)__doc__typingr   r   r   r    r   r   _utilsr	   strr   intr   __all__ r   r   <module>r       sg    S & &  ' %
P), 
PS#X 
P	J)!4 	J 	J r   