pub trait TensorType:
Debug
+ PartialEq
+ Copy
+ Sync
+ Send
+ 'static {
const DTYPE: GGmlType;
Show 17 methods
// Required methods
fn to_f32(&self) -> f32;
fn to_f16(&self) -> f16;
fn to_i32(&self) -> i32;
fn to_usize(&self) -> usize;
fn from_f32(x: f32) -> Self;
fn from_x<X: TensorType>(x: X) -> Self;
fn reduce_sum(chunk: &[Self]) -> Self;
fn vec_silu(n: usize, y: &mut [Self], x: &[Self]);
fn vec_scale(n: usize, y: &mut [Self], v: Self);
fn softmax(nc: usize, dp: &mut [Self], sp: &[Self]);
fn rms_norm(ne00: usize, x: &[Self], y: &mut [Self], eps: f32);
fn vec_add(inp1: &[Self], inp2: &[Self], dst: &mut [Self]);
fn vec_mul(inp1: &[Self], inp2: &[Self], dst: &mut [Self]);
// Provided methods
fn zeros() -> Self { ... }
fn byte_size() -> usize { ... }
fn blck_size() -> usize { ... }
fn is_quantized(&self) -> bool { ... }
}Required Associated Constants§
Required Methods§
fn to_f32(&self) -> f32
fn to_f16(&self) -> f16
fn to_i32(&self) -> i32
fn to_usize(&self) -> usize
fn from_f32(x: f32) -> Self
fn from_x<X: TensorType>(x: X) -> Self
fn reduce_sum(chunk: &[Self]) -> Self
fn vec_silu(n: usize, y: &mut [Self], x: &[Self])
fn vec_scale(n: usize, y: &mut [Self], v: Self)
fn softmax(nc: usize, dp: &mut [Self], sp: &[Self])
fn rms_norm(ne00: usize, x: &[Self], y: &mut [Self], eps: f32)
fn vec_add(inp1: &[Self], inp2: &[Self], dst: &mut [Self])
fn vec_mul(inp1: &[Self], inp2: &[Self], dst: &mut [Self])
Provided Methods§
fn zeros() -> Self
fn byte_size() -> usize
fn blck_size() -> usize
fn is_quantized(&self) -> bool
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".