+
    &j7                     6    ^ RI Ht ^ RIt^ RIHt RR R lltR# )    )AnyN)_get_device_indexc                H    V ^8  d   QhR\         R\        R\        R\        /# )   deviceoptional	allow_cpureturn)r   boolint)formats   "h/Users/jameslopez/projects/CWCArchive/cwc-podcast/.venv/lib/python3.14/site-packages/torch/xpu/_utils.py__annotate__r   	   s2     @ @@@48@@    c                $   \        V \        4      '       d   V # \        V \        4      '       d   \        P                  ! V 4      p \        V \        P                  4      '       dH   V'       d!   V P
                  R9  d   \        RV  24      hMV P
                  R8w  d   \        RV  24      h\        P                  P                  4       '       g7   \        V \        P                  P                  4      '       d   V P                  # \        WV4      # )a  Get the device index from :attr:`device`, which can be a torch.device
object, a Python integer, or ``None``.

If :attr:`device` is a torch.device object, returns the device index if it
is a XPU device. Note that for a XPU device without a specified index,
i.e., ``torch.device('xpu')``, this will return the current default XPU
device if :attr:`optional` is ``True``. If :attr:`allow_cpu` is ``True``,
CPU devices will be accepted and ``-1`` will be returned in this case.

If :attr:`device` is a Python integer, it is returned as is.

If :attr:`device` is ``None``, this will return the current default XPU
device if :attr:`optional` is ``True``.
xpuz'Expected a xpu or cpu device, but got: z Expected a xpu device, but got: )r   cpu)
isinstancer   strtorchr   type
ValueErrorjitis_scriptingr   idx_torch_get_device_index)r   r   r	   s   &&&r   r   r   	   s    " &#&#f%&%,,''{{.0 #J6(!STT 1[[E!?xHII99!!##feii..//::"6Y??r   )FF)typingr   r   torch._utilsr   r    r   r   <module>r       s      F@ @r   