#[non_exhaustive]pub struct DeviceCapabilities {
pub cpu: bool,
pub cuda: bool,
pub cuda_device_count: usize,
pub cudnn: bool,
pub mps: bool,
}Expand description
Backends that can actually be used by the current process.
Obtain this value from available_devices; future releases may report
additional capabilities.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.cpu: boolWhether the CPU backend is available. This is always true.
cuda: boolWhether at least one CUDA device is usable.
cuda_device_count: usizeNumber of usable CUDA devices exposed by LibTorch.
cudnn: boolWhether cuDNN is available with the CUDA backend.
mps: boolWhether an MPS tensor operation succeeds in this process.
Trait Implementations§
Source§impl Clone for DeviceCapabilities
impl Clone for DeviceCapabilities
Source§fn clone(&self) -> DeviceCapabilities
fn clone(&self) -> DeviceCapabilities
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for DeviceCapabilities
Source§impl Debug for DeviceCapabilities
impl Debug for DeviceCapabilities
impl Eq for DeviceCapabilities
Source§impl PartialEq for DeviceCapabilities
impl PartialEq for DeviceCapabilities
impl StructuralPartialEq for DeviceCapabilities
Auto Trait Implementations§
impl Freeze for DeviceCapabilities
impl RefUnwindSafe for DeviceCapabilities
impl Send for DeviceCapabilities
impl Sync for DeviceCapabilities
impl Unpin for DeviceCapabilities
impl UnsafeUnpin for DeviceCapabilities
impl UnwindSafe for DeviceCapabilities
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