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§
Implementations§
source§impl CpuStorage
impl CpuStorage
pub fn as_slice<D: WithDType>(&self) -> Result<&[D]>
pub fn concat(storages: &[CpuStorage]) -> Result<CpuStorage>
Trait Implementations§
source§impl BackendStorage for CpuStorage
impl BackendStorage for CpuStorage
type Device = CpuDevice
fn dtype(&self) -> DType
fn to_dtype(&self, layout: &Layout, dtype: DType) -> Result<Self>
fn reduce_op( &self, op: ReduceOp, layout: &Layout, reduce_dims: &[usize] ) -> Result<Self>
fn cmp( &self, op: CmpOp, rhs: &Self, lhs_l: &Layout, rhs_l: &Layout ) -> Result<Self>
fn affine(&self, layout: &Layout, mul: f64, add: f64) -> Result<Self>
fn avg_pool2d( &self, layout: &Layout, kernel_size: (usize, usize), stride: (usize, usize) ) -> Result<Self>
fn max_pool2d( &self, layout: &Layout, kernel_size: (usize, usize), stride: (usize, usize) ) -> Result<Self>
fn upsample_nearest1d(&self, layout: &Layout, sz: usize) -> Result<Self>
fn upsample_nearest2d( &self, layout: &Layout, h: usize, w: usize ) -> Result<Self>
fn powf(&self, layout: &Layout, e: f64) -> Result<Self>
fn elu(&self, layout: &Layout, alpha: f64) -> Result<Self>
fn unary_impl<B: UnaryOpT>(&self, layout: &Layout) -> Result<Self>
fn binary_impl<B: BinaryOpT>( &self, rhs: &Self, lhs_l: &Layout, rhs_l: &Layout ) -> Result<Self>
fn copy_strided_src( &self, dst: &mut Self, dst_offset: usize, src_l: &Layout ) -> Result<()>
fn where_cond( &self, layout: &Layout, t: &Self, t_l: &Layout, f: &Self, f_l: &Layout ) -> Result<Self>
fn conv1d( &self, l: &Layout, kernel: &Self, kernel_l: &Layout, params: &ParamsConv1D ) -> Result<Self>
fn conv2d( &self, l: &Layout, kernel: &Self, kernel_l: &Layout, params: &ParamsConv2D ) -> Result<Self>
fn conv_transpose2d( &self, l: &Layout, kernel: &Self, kernel_l: &Layout, params: &ParamsConvTranspose2D ) -> Result<Self>
fn index_select( &self, ids: &Self, l: &Layout, ids_l: &Layout, dim: usize ) -> Result<Self>
fn gather( &self, l: &Layout, ids: &Self, ids_l: &Layout, dim: usize ) -> Result<Self>
fn scatter_add( &self, l: &Layout, ids: &Self, ids_l: &Layout, src: &Self, src_l: &Layout, dim: usize ) -> Result<Self>
fn index_add( &self, l: &Layout, ids: &Self, ids_l: &Layout, src: &Self, src_l: &Layout, dim: usize ) -> Result<Self>
fn matmul( &self, rhs: &Self, bmnk: (usize, usize, usize, usize), lhs_l: &Layout, rhs_l: &Layout ) -> Result<Self>
fn device(&self) -> &Self::Device
fn try_clone(&self, _: &Layout) -> Result<Self>
fn to_cpu_storage(&self) -> Result<CpuStorage>
source§impl Clone for CpuStorage
impl Clone for CpuStorage
source§fn clone(&self) -> CpuStorage
fn clone(&self) -> CpuStorage
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 moreAuto Trait Implementations§
impl RefUnwindSafe for CpuStorage
impl Send for CpuStorage
impl Sync for CpuStorage
impl Unpin for CpuStorage
impl UnwindSafe for CpuStorage
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