Struct tvm::function::ffi::DLDataType [−][src]
Expand description
\brief The data type the tensor can hold.
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
: type_code = 5, bits = 64, lanes = 1
Fields
code: u8
\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: u8
\brief Number of bits, common choices are 8, 16, 32.
lanes: u16
\brief Number of lanes in the type, used for vector types.
Trait Implementations
Returns the “default value” for a type. Read more
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
type Error = ValueDowncastError
type Error = ValueDowncastError
The type returned in the event of a conversion error.
pub fn try_from(
val: &'a ArgValue<'v>
) -> Result<DLDataType, <DLDataType as TryFrom<&'a ArgValue<'v>>>::Error>
pub fn try_from(
val: &'a ArgValue<'v>
) -> Result<DLDataType, <DLDataType as TryFrom<&'a ArgValue<'v>>>::Error>
Performs the conversion.
type Error = ValueDowncastError
type Error = ValueDowncastError
The type returned in the event of a conversion error.
pub fn try_from(
val: ArgValue<'a>
) -> Result<DLDataType, <DLDataType as TryFrom<ArgValue<'a>>>::Error>
pub fn try_from(
val: ArgValue<'a>
) -> Result<DLDataType, <DLDataType as TryFrom<ArgValue<'a>>>::Error>
Performs the conversion.
type Error = ValueDowncastError
type Error = ValueDowncastError
The type returned in the event of a conversion error.
pub fn try_from(
val: RetValue
) -> Result<DLDataType, <DLDataType as TryFrom<RetValue>>::Error>
pub fn try_from(
val: RetValue
) -> Result<DLDataType, <DLDataType as TryFrom<RetValue>>::Error>
Performs the conversion.
Auto Trait Implementations
impl RefUnwindSafe for DLDataType
impl Send for DLDataType
impl Sync for DLDataType
impl Unpin for DLDataType
impl UnwindSafe for DLDataType
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more