Skip to main content

AsDLDataType

Trait AsDLDataType 

Source
pub unsafe trait AsDLDataType: Copy {
    const DL_DATA_TYPE: DLDataType;
}
Expand description

A Rust element type of a tensor, such as f32, and its DLDataType.

§Safety

Tensor data of DL_DATA_TYPE is read as Self without checks, so Self must have that data type’s item size, be no more aligned than the item size, and accept every bit pattern of it.

Required Associated Constants§

Source

const DL_DATA_TYPE: DLDataType

The data type of Self.

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 AsDLDataType for f32

Source§

impl AsDLDataType for f64

Source§

impl AsDLDataType for i8

Source§

impl AsDLDataType for i16

Source§

impl AsDLDataType for i32

Source§

impl AsDLDataType for i64

Source§

impl AsDLDataType for u8

Source§

impl AsDLDataType for u16

Source§

impl AsDLDataType for u32

Source§

impl AsDLDataType for u64

Implementors§