pub trait WithDType: Sized + Copy + NumAssign + PartialOrd + Display + 'static + Send + Sync + VecOps {
    const DTYPE: DType;

    // Required methods
    fn from_f64(v: f64) -> Self;
    fn to_f64(self) -> f64;
    fn to_cpu_storage_owned(data: Vec<Self>) -> CpuStorage;
    fn cpu_storage_as_slice(s: &CpuStorage) -> Result<&[Self]>;
    fn cpu_storage_data(s: CpuStorage) -> Result<Vec<Self>>;

    // Provided method
    fn to_cpu_storage(data: &[Self]) -> CpuStorage { ... }
}

Required Associated Constants§

Required Methods§

Provided Methods§

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl WithDType for f32

source§

impl WithDType for f64

source§

impl WithDType for i64

source§

impl WithDType for u8

source§

impl WithDType for u32

source§

impl WithDType for bf16

source§

impl WithDType for f16

Implementors§