#[repr(C)]pub struct DLDataType {
pub code: u8,
pub bits: u8,
pub lanes: u16,
}
Expand description
DLPack data type struct
Fields§
§code: u8
§bits: u8
§lanes: u16
Implementations§
Source§impl DLDataType
impl DLDataType
pub fn new(code: DLDataTypeCode, bits: u8, lanes: u16) -> DLDataType
Trait Implementations§
Source§impl AnyCompatible for DLDataType
AnyCompatible implementation for DLDataType
impl AnyCompatible for DLDataType
AnyCompatible implementation for DLDataType
This implementation allows DLDataType to be used with the TVM FFI Any system, enabling type-safe conversion between DLDataType and the generic Any type.
Source§fn type_str() -> String
fn type_str() -> String
Get the type string identifier for DLDataType
§Returns
The string “DataType” to match the C++ representation
Source§unsafe fn copy_to_any_view(src: &Self, data: &mut TVMFFIAny)
unsafe fn copy_to_any_view(src: &Self, data: &mut TVMFFIAny)
Copy a DLDataType to an Any view
§Arguments
src
- The DLDataType to copy fromdata
- The Any view to copy to
Source§unsafe fn move_to_any(src: Self, data: &mut TVMFFIAny)
unsafe fn move_to_any(src: Self, data: &mut TVMFFIAny)
Move a DLDataType into an Any
§Arguments
src
- The DLDataType to move fromdata
- The Any to move into
Source§unsafe fn check_any_strict(data: &TVMFFIAny) -> bool
unsafe fn check_any_strict(data: &TVMFFIAny) -> bool
Source§unsafe fn copy_from_any_view_after_check(data: &TVMFFIAny) -> Self
unsafe fn copy_from_any_view_after_check(data: &TVMFFIAny) -> Self
Source§unsafe fn move_from_any_after_check(data: &mut TVMFFIAny) -> Self
unsafe fn move_from_any_after_check(data: &mut TVMFFIAny) -> Self
Source§fn get_mismatch_type_info(data: &TVMFFIAny) -> String
fn get_mismatch_type_info(data: &TVMFFIAny) -> String
Get the type key of a type when TryCastFromAnyView fails.
Source§impl Clone for DLDataType
impl Clone for DLDataType
Source§fn clone(&self) -> DLDataType
fn clone(&self) -> DLDataType
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl DLDataTypeExt for DLDataType
impl DLDataTypeExt for DLDataType
Source§impl Debug for DLDataType
impl Debug for DLDataType
Source§impl PartialEq for DLDataType
impl PartialEq for DLDataType
Source§impl TryFrom<Any> for DLDataType
impl TryFrom<Any> for DLDataType
Source§impl<'a> TryFrom<AnyView<'a>> for DLDataType
impl<'a> TryFrom<AnyView<'a>> for DLDataType
impl Copy for DLDataType
impl Eq for DLDataType
impl StructuralPartialEq for DLDataType
Auto Trait Implementations§
impl Freeze for DLDataType
impl RefUnwindSafe for DLDataType
impl Send for DLDataType
impl Sync for DLDataType
impl Unpin for DLDataType
impl UnwindSafe for DLDataType
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