Enum burn::backend::candle::CandleDevice
pub enum CandleDevice {
Cpu,
Cuda(CudaDevice),
Metal(MetalDevice),
}
Expand description
The device type for the candle backend.
The device struct when using the candle
backend.
To create a Cuda or Metal device from the index, use the associated methods to create the variant:
use burn_candle::CandleDevice;
// Create a Cuda device from its index
let device = CandleDevice::cuda(0);
// Create a Metal device from its index
let device = CandleDevice::metal(0);
Variants§
Cpu
CPU device.
Cuda(CudaDevice)
Cuda device with the given index. The index is the index of the Cuda device in the list of all Cuda devices found on the system.
Metal(MetalDevice)
Metal device with the given index. The index is the index of the Metal device in the list of all Metal devices found on the system.
Implementations§
§impl CandleDevice
impl CandleDevice
pub fn cuda(index: usize) -> CandleDevice
pub fn cuda(index: usize) -> CandleDevice
Create a Cuda device with the given index. The index is the index of the Cuda device in the list of all Cuda devices found on the system.
pub fn metal(index: usize) -> CandleDevice
pub fn metal(index: usize) -> CandleDevice
Create a Metal device with the given index. The index is the index of the Metal device in the list of all Metal devices found on the system.
Trait Implementations§
§impl Clone for CandleDevice
impl Clone for CandleDevice
§fn clone(&self) -> CandleDevice
fn clone(&self) -> CandleDevice
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more§impl Debug for CandleDevice
impl Debug for CandleDevice
§impl Default for CandleDevice
impl Default for CandleDevice
§fn default() -> CandleDevice
fn default() -> CandleDevice
Returns the “default value” for a type. Read more
§impl From<CandleDevice> for Device
impl From<CandleDevice> for Device
§fn from(device: CandleDevice) -> Device
fn from(device: CandleDevice) -> Device
Converts to this type from the input type.
§impl From<Device> for CandleDevice
impl From<Device> for CandleDevice
§fn from(device: Device) -> CandleDevice
fn from(device: Device) -> CandleDevice
Converts to this type from the input type.
§impl PartialEq for CandleDevice
impl PartialEq for CandleDevice
impl Eq for CandleDevice
impl StructuralPartialEq for CandleDevice
Auto Trait Implementations§
impl Freeze for CandleDevice
impl RefUnwindSafe for CandleDevice
impl Send for CandleDevice
impl Sync for CandleDevice
impl Unpin for CandleDevice
impl UnwindSafe for CandleDevice
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian()
.