TensorInitContext

Trait TensorInitContext 

Source
pub trait TensorInitContext<T: Scalar>: Sized {
    // Required methods
    fn from_data<'a, S, D>(
        context: &Context,
        shape: S,
        data: D,
    ) -> Result<Self, TensorError>
       where S: Into<Shape>,
             D: Into<Cow<'a, [T]>>;
    fn init(context: &Context, shape: impl Into<Shape>) -> Self;
}

Required Methods§

Source

fn from_data<'a, S, D>( context: &Context, shape: S, data: D, ) -> Result<Self, TensorError>
where S: Into<Shape>, D: Into<Cow<'a, [T]>>,

Init the tensor with given shape and contents.

Source

fn init(context: &Context, shape: impl Into<Shape>) -> Self

Init the tensor with given shape.

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§