candle_core::backend

Trait BackendStorage

Source
pub trait BackendStorage: Sized {
    type Device: BackendDevice;

Show 28 methods // Required methods fn try_clone(&self, _: &Layout) -> Result<Self>; fn dtype(&self) -> DType; fn device(&self) -> &Self::Device; fn to_cpu_storage(&self) -> Result<CpuStorage>; fn affine(&self, _: &Layout, _: f64, _: f64) -> Result<Self>; fn powf(&self, _: &Layout, _: f64) -> Result<Self>; fn elu(&self, _: &Layout, _: f64) -> Result<Self>; fn reduce_op(&self, _: ReduceOp, _: &Layout, _: &[usize]) -> Result<Self>; fn cmp(&self, _: CmpOp, _: &Self, _: &Layout, _: &Layout) -> Result<Self>; fn to_dtype(&self, _: &Layout, _: DType) -> Result<Self>; fn unary_impl<B: UnaryOpT>(&self, _: &Layout) -> Result<Self>; fn binary_impl<B: BinaryOpT>( &self, _: &Self, _: &Layout, _: &Layout, ) -> Result<Self>; fn where_cond( &self, _: &Layout, _: &Self, _: &Layout, _: &Self, _: &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 avg_pool2d( &self, _: &Layout, _: (usize, usize), _: (usize, usize), ) -> Result<Self>; fn max_pool2d( &self, _: &Layout, _: (usize, usize), _: (usize, usize), ) -> Result<Self>; fn upsample_nearest1d(&self, _: &Layout, _: usize) -> Result<Self>; fn upsample_nearest2d(&self, _: &Layout, _: usize, _: usize) -> Result<Self>; fn gather(&self, _: &Layout, _: &Self, _: &Layout, _: usize) -> Result<Self>; fn scatter_add( &self, _: &Layout, _: &Self, _: &Layout, _: &Self, _: &Layout, _: usize, ) -> Result<Self>; fn index_select( &self, _: &Self, _: &Layout, _: &Layout, _: usize, ) -> Result<Self>; fn index_add( &self, _: &Layout, _: &Self, _: &Layout, _: &Self, _: &Layout, _: usize, ) -> Result<Self>; fn matmul( &self, _: &Self, _: (usize, usize, usize, usize), _: &Layout, _: &Layout, ) -> Result<Self>; fn copy_strided_src(&self, _: &mut Self, _: usize, _: &Layout) -> Result<()>; fn copy2d( &self, _: &mut Self, _d1: usize, _d2: usize, _src_stride1: usize, _dst_stride1: usize, _src_offset: usize, _dst_offset: usize, ) -> Result<()>;
}

Required Associated Types§

Required Methods§

Source

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

Source

fn dtype(&self) -> DType

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

fn where_cond( &self, _: &Layout, _: &Self, _: &Layout, _: &Self, _: &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 avg_pool2d( &self, _: &Layout, _: (usize, usize), _: (usize, usize), ) -> Result<Self>

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

fn copy2d( &self, _: &mut Self, _d1: usize, _d2: usize, _src_stride1: usize, _dst_stride1: usize, _src_offset: usize, _dst_offset: usize, ) -> Result<()>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§