Skip to main content

WithDType

Trait WithDType 

Source
pub trait WithDType:
    Sized
    + Copy
    + NumAssign
    + PartialOrd
    + 'static
    + Clone
    + Send
    + Sync
    + Debug
    + Display {
    type Formatter: TensorFormatter<Elem = Self>;

    const DTYPE: DType;
    const BYTE_SIZE: usize;

    // Required method
    fn vec_from_le_bytes(src: &[u8]) -> Vec<Self>;
}

Required Associated Constants§

Required Associated Types§

Source

type Formatter: TensorFormatter<Elem = Self>

Required Methods§

Source

fn vec_from_le_bytes(src: &[u8]) -> Vec<Self>

Convert a little-endian byte slice to a Vec of Self. This handles alignment safely by reading bytes individually.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl WithDType for bf16

Source§

impl WithDType for f16

Source§

impl WithDType for f32

Source§

impl WithDType for i64

Source§

impl WithDType for u8

Implementors§