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§
Sourceconst DL_DATA_TYPE: DLDataType
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.