pub struct DeviceManager { /* private fields */ }Expand description
Device manager for tensor operations
Implementations§
Source§impl DeviceManager
impl DeviceManager
Sourcepub fn available_devices(&self) -> &[TensorDevice]
pub fn available_devices(&self) -> &[TensorDevice]
Get available devices
Sourcepub fn set_device(&mut self, device: TensorDevice)
pub fn set_device(&mut self, device: TensorDevice)
Set current device
Sourcepub fn current_device(&self) -> TensorDevice
pub fn current_device(&self) -> TensorDevice
Get current device
Sourcepub fn memory_usage(&self, device: TensorDevice) -> usize
pub fn memory_usage(&self, device: TensorDevice) -> usize
Get memory usage for device
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DeviceManager
impl RefUnwindSafe for DeviceManager
impl Send for DeviceManager
impl Sync for DeviceManager
impl Unpin for DeviceManager
impl UnwindSafe for DeviceManager
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> 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