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 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_set( &mut self, l: &Layout, ids: &Self, ids_l: &Layout, src: &Self, src_l: &Layout, dim: usize, ) -> Result<()>
fn scatter_add_set( &mut self, l: &Layout, ids: &Self, ids_l: &Layout, src: &Self, src_l: &Layout, dim: usize, ) -> Result<()>
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>
fn const_set(&mut self, s: Scalar, l: &Layout) -> Result<()>
Source§impl Clone for CpuStorage
impl Clone for CpuStorage
Source§fn clone(&self) -> CpuStorage
fn clone(&self) -> CpuStorage
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const 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§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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