o
    ei                     @   s0   d dl Z d dlmZ d	dededefddZdS )
    N)DeviceFdeviceoptionalreturnc                 C   s   t | tr| S t | trt| } d }t | tjr:tj }|d u r&td|j| jkr7t	| j d| d| j
}|d u rL|sGt	d|  tj S |S )NzAccelerator expectedz' doesn't match the current accelerator .zFExpected a torch.device with a specified index or an integer, but got:)
isinstanceintstrtorchr   acceleratorcurrent_acceleratorRuntimeErrortype
ValueErrorindexcurrent_device_index)r   r   device_indexacc r   b/var/www/addictedbytheproject.nl/epg/venv/lib/python3.10/site-packages/torch/accelerator/_utils.py_get_device_index   s*   




r   )F)r
   torch.typesr   	_device_tboolr   r   r   r   r   r   <module>   s    