pub trait SimpleBackend: Send + Sync {
// Required methods
fn get(
&self,
s: Shape,
name: &str,
h: Init,
dtype: DType,
dev: &Device,
) -> Result<Tensor>;
fn get_unchecked(
&self,
name: &str,
dtype: DType,
dev: &Device,
) -> Result<Tensor>;
fn contains_tensor(&self, name: &str) -> bool;
}
Required Methods§
sourcefn get(
&self,
s: Shape,
name: &str,
h: Init,
dtype: DType,
dev: &Device,
) -> Result<Tensor>
fn get( &self, s: Shape, name: &str, h: Init, dtype: DType, dev: &Device, ) -> Result<Tensor>
Retrieve a tensor based on a target name and shape.
sourcefn get_unchecked(
&self,
name: &str,
dtype: DType,
dev: &Device,
) -> Result<Tensor>
fn get_unchecked( &self, name: &str, dtype: DType, dev: &Device, ) -> Result<Tensor>
Retrieve a tensor based on the name.
fn contains_tensor(&self, name: &str) -> bool
Trait Implementations§
source§impl Backend for Box<dyn SimpleBackend + '_>
impl Backend for Box<dyn SimpleBackend + '_>
type Hints = Init
source§fn get(
&self,
s: Shape,
name: &str,
h: Self::Hints,
dtype: DType,
dev: &Device,
) -> Result<Tensor>
fn get( &self, s: Shape, name: &str, h: Self::Hints, dtype: DType, dev: &Device, ) -> Result<Tensor>
Retrieve a tensor with some target shape.
source§fn get_unchecked(
&self,
name: &str,
dtype: DType,
dev: &Device,
) -> Result<Tensor>
fn get_unchecked( &self, name: &str, dtype: DType, dev: &Device, ) -> Result<Tensor>
Retrieve a tensor based on the name.