#[repr(C)]pub struct DataType {
pub code: DataTypeCode,
pub bits: u8,
pub lanes: u16,
}Expand description
The data type the tensor can hold. The data type is assumed to follow the native endian-ness. An explicit error message should be raised when attempting to export an array with non-native endianness Examples
- float: type_code = 2, bits = 32, lanes=1
- float4(vectorized 4 float): type_code = 2, bits = 32, lanes=4
- int8: type_code = 0, bits = 8, lanes=1
std::complex<float>: type_code = 5, bits = 64, lanes = 1
Fields§
§code: DataTypeCodeType code of base types.
bits: u8Number of bits, common choices are 8, 16, 32.
lanes: u16Number of lanes in the type, used for vector types.
Implementations§
Source§impl DataType
impl DataType
pub const BF16: Self
pub const BOOL: Self
pub const F16: Self
pub const F32: Self
pub const F64: Self
pub const I128: Self
pub const I16: Self
pub const I32: Self
pub const I64: Self
pub const I8: Self
pub const U128: Self
pub const U16: Self
pub const U32: Self
pub const U64: Self
pub const U8: Self
Trait Implementations§
impl Copy for DataType
impl Eq for DataType
impl StructuralPartialEq for DataType
Auto Trait Implementations§
impl Freeze for DataType
impl RefUnwindSafe for DataType
impl Send for DataType
impl Sync for DataType
impl Unpin for DataType
impl UnsafeUnpin for DataType
impl UnwindSafe for DataType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more