#[non_exhaustive]pub enum DeviceSpec {
Auto,
Cpu,
Cuda(usize),
Mps,
}Expand description
A device request that is resolved against the linked LibTorch build.
New backend requests may be added in future releases.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Auto
Selects CUDA device 0, then MPS, then CPU, in that order of availability.
Cpu
Selects the CPU backend.
Cuda(usize)
Selects the CUDA device at the given zero-based index.
Mps
Selects Apple’s Metal Performance Shaders backend.
Trait Implementations§
Source§impl Clone for DeviceSpec
impl Clone for DeviceSpec
impl Copy for DeviceSpec
Source§impl Debug for DeviceSpec
impl Debug for DeviceSpec
impl Eq for DeviceSpec
Source§impl PartialEq for DeviceSpec
impl PartialEq for DeviceSpec
impl StructuralPartialEq for DeviceSpec
Auto Trait Implementations§
impl Forget for DeviceSpec
impl Freeze for DeviceSpec
impl RefUnwindSafe for DeviceSpec
impl Send for DeviceSpec
impl Sync for DeviceSpec
impl Unpin for DeviceSpec
impl UnsafeUnpin for DeviceSpec
impl UnwindSafe for DeviceSpec
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more