DLDataType
\brief 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
structExamples
- 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
- bool: type_code = 6, bits = 8, lanes = 1 (as per common array library convention, the underlying storage size of bool is 8 bits)
Fields
code
field[source]uint8_t code\brief Type code of base types. We keep it uint8_t instead of DLDataTypeCode for minimal memory footprint, but the value should be one of DLDataTypeCode enum values.
bits
field[source]uint8_t bits\brief Number of bits, common choices are 8, 16, 32.
lanes
field[source]uint16_t lanes\brief Number of lanes in the type, used for vector types.