Skip to main content

RefBackend

Struct RefBackend 

Source
pub struct RefBackend;
Expand description

Pure Rust reference implementation of KernelBackend.

Used for CI testing and platforms where no hardware-accelerated backend is available.

Trait Implementations§

Source§

impl KernelBackend for RefBackend

Source§

fn conv2d(&mut self, params: Conv2dParams<'_>) -> Status

Execute a 2D convolution. Read more
Source§

fn depthwise_conv2d(&mut self, params: DepthwiseConv2dParams<'_>) -> Status

Execute a depthwise 2D convolution. Read more
Source§

fn fully_connected(&mut self, params: FullyConnectedParams<'_>) -> Status

Execute a fully-connected layer. Read more
Source§

fn avg_pool(&mut self, params: PoolParams<'_>) -> Status

Execute average pooling. Read more
Source§

fn max_pool(&mut self, params: PoolParams<'_>) -> Status

Execute max pooling. Read more
Source§

fn softmax(&mut self, params: SoftmaxParams<'_>) -> Status

Execute softmax. Read more
Source§

fn add(&mut self, params: ElementwiseAddParams<'_>) -> Status

Execute element-wise addition. Read more
Source§

fn conv2d_scratch_size( input_shape: [usize; 4], weights_shape: [usize; 4], output_shape: [usize; 4], ) -> usize
where Self: Sized,

Returns the scratch buffer size in bytes required by Self::conv2d. Read more
Source§

fn depthwise_conv2d_scratch_size( input_shape: [usize; 4], weights_shape: [usize; 4], output_shape: [usize; 4], ) -> usize
where Self: Sized,

Returns the scratch buffer size in bytes required by Self::depthwise_conv2d.
Source§

fn softmax_scratch_size(num_classes: usize) -> usize
where Self: Sized,

Returns the scratch buffer size in bytes required by Self::softmax.

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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>,

Source§

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.