WithDType

Trait WithDType 

Source
pub trait WithDType:
    Copy
    + Clone
    + 'static
    + Zero
    + One {
    const DTYPE: DType;

    // Required methods
    fn to_cpu_storage(data: &[Self]) -> CpuStorageRef<'_>;
    fn from_cpu_storage(data: CpuStorageRef<'_>) -> Result<&[Self], Error>;
    fn to_cpu_storage_mut(data: &mut [Self]) -> CpuStorageRefMut<'_>;
    fn from_cpu_storage_mut(
        data: CpuStorageRefMut<'_>,
    ) -> Result<&mut [Self], Error>;
}

Required Associated Constants§

Required Methods§

Source

fn to_cpu_storage(data: &[Self]) -> CpuStorageRef<'_>

Source

fn from_cpu_storage(data: CpuStorageRef<'_>) -> Result<&[Self], Error>

Source

fn to_cpu_storage_mut(data: &mut [Self]) -> CpuStorageRefMut<'_>

Source

fn from_cpu_storage_mut( data: CpuStorageRefMut<'_>, ) -> Result<&mut [Self], Error>

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.

Implementations on Foreign Types§

Source§

impl WithDType for f32

Source§

impl WithDType for i32

Source§

impl WithDType for i64

Source§

impl WithDType for bf16

Source§

impl WithDType for f16

Implementors§