pub enum Device {
Cpu,
}Expand description
Represents a compute device where tensors can be allocated and operations executed.
Variants§
Cpu
CPU device (always available).
Implementations§
Source§impl Device
impl Device
Sourcepub fn is_available(self) -> bool
pub fn is_available(self) -> bool
Returns true if this device is available on the current system.
Sourcepub const fn device_type(self) -> &'static str
pub const fn device_type(self) -> &'static str
Returns the name of this device type.
Source§impl Device
impl Device
Sourcepub fn capabilities(self) -> DeviceCapabilities
pub fn capabilities(self) -> DeviceCapabilities
Returns the capabilities of this device.
Trait Implementations§
impl Copy for Device
impl Eq for Device
impl StructuralPartialEq for Device
Auto Trait Implementations§
impl Freeze for Device
impl RefUnwindSafe for Device
impl Send for Device
impl Sync for Device
impl Unpin for Device
impl UnwindSafe for Device
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more