+
    &j|                     *    ^ RI Ht ^ RItRR R lltR# )    )AnyNc                H    V ^8  d   QhR\         R\        R\        R\        /# )   deviceoptional	allow_cpureturn)r   boolint)formats   "i/Users/jameslopez/projects/CWCArchive/cwc-podcast/.venv/lib/python3.14/site-packages/torch/mtia/_utils.py__annotate__r      s,     ) )))48))    c                   V f'   V'       d   \         P                  P                  4       # \        V \        4      '       d   V # \         P
                  P                  4       '       g7   \        V \         P                  P                  4      '       d   V P                  # \        V \        4      '       d   \         P                  ! V 4      p Rp\        V \         P                  4      '       df   V'       g    V P                  R8X  d   \        RV  24      hV P                  R9  d   \        RV  24      hV P                  R8X  d   RMV P                  pVf7   V'       d!   \         P                  P                  4       pV# \        RV  24      hV# )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 MTIA device. Note that for a MTIA device without a specified index,
i.e., ``torch.device('mtia')``, this will return the current default MTIA
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 MTIA
device if :attr:`optional` is ``True``.
Ncpuz$Expected a non cpu device, but got: z(Expected a mtia or cpu device, but got: zGExpected a torch.device with a specified index or an integer, but got: )mtiar   )torch_C_mtia_getDevice
isinstancer   jitis_scriptingr   r   idxstrtype
ValueErrorindex)r   r   r   
device_idxs   &&& r   _get_device_indexr       s1   " ~(xx''))&#99!!##fejj//00::&#f%!J&%,,''V[[E1CF8LMM;;o-GxPQQ!;;%/RV\\
113J
  YZ`Yab  r   )FF)typingr   r   r     r   r   <module>r#      s     ) )r   