Trait web_rwkv::tensor::TensorInit
source · pub trait TensorInit<'a, T: Scalar>: Sized {
// Required methods
fn from_data(
context: &Context,
shape: Shape,
data: impl Into<Cow<'a, [T]>>
) -> Result<Self, TensorError>;
fn init(context: &Context, shape: Shape) -> Self;
// Provided method
fn from_safetensors(
context: &Context,
tensor: TensorView<'a>
) -> Result<Self, TensorError> { ... }
}Required Methods§
fn from_data( context: &Context, shape: Shape, data: impl Into<Cow<'a, [T]>> ) -> Result<Self, TensorError>
fn init(context: &Context, shape: Shape) -> Self
Provided Methods§
fn from_safetensors( context: &Context, tensor: TensorView<'a> ) -> Result<Self, TensorError>
Object Safety§
This trait is not object safe.