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§
Sourcefn from_data<'a, S, D>(
context: &Context,
shape: S,
data: D,
) -> Result<Self, TensorError>
fn from_data<'a, S, D>( context: &Context, shape: S, data: D, ) -> Result<Self, TensorError>
Init the tensor with given shape and contents.
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.