Enum candle_core::cpu_backend::CpuStorage

source ·
pub enum CpuStorage {
    U8(Vec<u8>),
    U32(Vec<u32>),
    I64(Vec<i64>),
    BF16(Vec<bf16>),
    F16(Vec<f16>),
    F32(Vec<f32>),
    F64(Vec<f64>),
}

Variants§

§

U8(Vec<u8>)

§

U32(Vec<u32>)

§

I64(Vec<i64>)

§

BF16(Vec<bf16>)

§

F16(Vec<f16>)

§

F32(Vec<f32>)

§

F64(Vec<f64>)

Implementations§

source§

impl CpuStorage

source

pub fn as_slice<D: WithDType>(&self) -> Result<&[D]>

source

pub fn concat(storages: &[CpuStorage]) -> Result<CpuStorage>

Trait Implementations§

source§

impl BackendStorage for CpuStorage

§

type Device = CpuDevice

source§

fn dtype(&self) -> DType

source§

fn to_dtype(&self, layout: &Layout, dtype: DType) -> Result<Self>

source§

fn reduce_op( &self, op: ReduceOp, layout: &Layout, reduce_dims: &[usize] ) -> Result<Self>

source§

fn cmp( &self, op: CmpOp, rhs: &Self, lhs_l: &Layout, rhs_l: &Layout ) -> Result<Self>

source§

fn affine(&self, layout: &Layout, mul: f64, add: f64) -> Result<Self>

source§

fn avg_pool2d( &self, layout: &Layout, kernel_size: (usize, usize), stride: (usize, usize) ) -> Result<Self>

source§

fn max_pool2d( &self, layout: &Layout, kernel_size: (usize, usize), stride: (usize, usize) ) -> Result<Self>

source§

fn upsample_nearest1d(&self, layout: &Layout, sz: usize) -> Result<Self>

source§

fn upsample_nearest2d( &self, layout: &Layout, h: usize, w: usize ) -> Result<Self>

source§

fn powf(&self, layout: &Layout, e: f64) -> Result<Self>

source§

fn elu(&self, layout: &Layout, alpha: f64) -> Result<Self>

source§

fn unary_impl<B: UnaryOpT>(&self, layout: &Layout) -> Result<Self>

source§

fn binary_impl<B: BinaryOpT>( &self, rhs: &Self, lhs_l: &Layout, rhs_l: &Layout ) -> Result<Self>

source§

fn copy2d( &self, dst: &mut Self, d1: usize, d2: usize, src_s: usize, dst_s: usize, src_o: usize, dst_o: usize ) -> Result<()>

source§

fn copy_strided_src( &self, dst: &mut Self, dst_offset: usize, src_l: &Layout ) -> Result<()>

source§

fn where_cond( &self, layout: &Layout, t: &Self, t_l: &Layout, f: &Self, f_l: &Layout ) -> Result<Self>

source§

fn conv1d( &self, l: &Layout, kernel: &Self, kernel_l: &Layout, params: &ParamsConv1D ) -> Result<Self>

source§

fn conv_transpose1d( &self, l: &Layout, kernel: &Self, kernel_l: &Layout, params: &ParamsConvTranspose1D ) -> Result<Self>

source§

fn conv2d( &self, l: &Layout, kernel: &Self, kernel_l: &Layout, params: &ParamsConv2D ) -> Result<Self>

source§

fn conv_transpose2d( &self, l: &Layout, kernel: &Self, kernel_l: &Layout, params: &ParamsConvTranspose2D ) -> Result<Self>

source§

fn index_select( &self, ids: &Self, l: &Layout, ids_l: &Layout, dim: usize ) -> Result<Self>

source§

fn gather( &self, l: &Layout, ids: &Self, ids_l: &Layout, dim: usize ) -> Result<Self>

source§

fn scatter_add( &self, l: &Layout, ids: &Self, ids_l: &Layout, src: &Self, src_l: &Layout, dim: usize ) -> Result<Self>

source§

fn index_add( &self, l: &Layout, ids: &Self, ids_l: &Layout, src: &Self, src_l: &Layout, dim: usize ) -> Result<Self>

source§

fn matmul( &self, rhs: &Self, bmnk: (usize, usize, usize, usize), lhs_l: &Layout, rhs_l: &Layout ) -> Result<Self>

source§

fn device(&self) -> &Self::Device

source§

fn try_clone(&self, _: &Layout) -> Result<Self>

source§

fn to_cpu_storage(&self) -> Result<CpuStorage>

source§

impl Clone for CpuStorage

source§

fn clone(&self) -> CpuStorage

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CpuStorage

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> ErasedDestructor for T
where T: 'static,