Trait rai_core::backend::Backend

source ·
pub trait Backend: Debug {
    // Required methods
    fn clone_boxed(&self) -> Box<dyn Backend>;
    fn data_type_id(&self) -> TypeId;
    fn as_any(&self) -> &dyn Any;
    fn equal(&self, rhs: &dyn Backend) -> bool;
    fn from_safetensor(&self, st: &TensorView<'_>) -> Tensor;
    fn to_safetensors(&self, tensors: HashMap<String, Tensor>, filename: &Path);

    // Provided method
    fn debug_info(&self) { ... }
}

Required Methods§

source

fn clone_boxed(&self) -> Box<dyn Backend>

source

fn data_type_id(&self) -> TypeId

source

fn as_any(&self) -> &dyn Any

source

fn equal(&self, rhs: &dyn Backend) -> bool

source

fn from_safetensor(&self, st: &TensorView<'_>) -> Tensor

source

fn to_safetensors(&self, tensors: HashMap<String, Tensor>, filename: &Path)

Provided Methods§

Trait Implementations§

source§

impl Clone for Box<dyn Backend>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<B, P> Eval<dyn Backend, dyn Primitive> for Dispatch<B, P>
where B: Backend + 'static + Sync + Send, P: Primitive + 'static + Sync + Send, Self: Eval<B, P> + 'static,

source§

fn eval( &self, backend: &dyn Backend, primitive: &dyn Primitive, inputs: &[Tensor], output: &Tensor )

source§

impl<'a> From<&'a Box<dyn Backend>> for Box<dyn Backend>

source§

fn from(t: &'a Box<dyn Backend>) -> Self

Converts to this type from the input type.
source§

impl<'a, T> From<&'a T> for Box<dyn Backend>
where T: Clone + Backend + 'static,

source§

fn from(t: &'a T) -> Self

Converts to this type from the input type.
source§

impl<'a> From<&'a dyn Backend> for Box<dyn Backend>

source§

fn from(t: &'a dyn Backend) -> Self

Converts to this type from the input type.
source§

impl From<&dyn Backend> for Device

source§

fn from(val: &dyn Backend) -> Self

Converts to this type from the input type.
source§

impl<'a> PartialEq for &'a dyn Backend

source§

fn eq(&self, rhs: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Implementors§