pub enum CpuStorage {
U8(Vec<u8>),
I8(Vec<i8>),
U32(Vec<u32>),
I16(Vec<i16>),
I32(Vec<i32>),
I64(Vec<i64>),
BF16(Vec<bf16>),
F16(Vec<f16>),
F32(Vec<f32>),
F64(Vec<f64>),
F8E4M3(Vec<F8E4M3>),
}
Variants§
U8(Vec<u8>)
I8(Vec<i8>)
U32(Vec<u32>)
I16(Vec<i16>)
I32(Vec<i32>)
I64(Vec<i64>)
BF16(Vec<bf16>)
F16(Vec<f16>)
F32(Vec<f32>)
F64(Vec<f64>)
F8E4M3(Vec<F8E4M3>)
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 copy2d( &self, dst: &mut Self, d1: usize, d2: usize, src_s: usize, dst_s: usize, src_o: usize, dst_o: usize, ) -> Result<()>
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 conv_transpose1d( &self, l: &Layout, kernel: &Self, kernel_l: &Layout, params: &ParamsConvTranspose1D, ) -> 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_with_alpha_beta( &self, rhs: &Self, c: &mut Self, s: Option<f64>, bmnk: (usize, usize, usize, usize), lhs_l: &Layout, rhs_l: &Layout, c_l: &Layout, ) -> Result<()>
fn matmul_with_alpha( &self, rhs: &Self, s: Option<f64>, 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 Freeze for CpuStorage
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
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
)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