Expand description
DLPack DataType. See DLDataType
Example
use dlpackrs::DataType;
let i32 = DataType::i32();
println!("bits: {}, lanes: {}", i32.bits, i32.lanes);
Fields
code: u8
bits: u8
lanes: u16
Implementations
sourceimpl DataType
impl DataType
pub const fn new(code: u8, bits: u8, lanes: u16) -> DataType
pub const fn code(&self) -> usize
pub const fn bits(&self) -> usize
pub const fn lanes(&self) -> usize
pub fn i8() -> DataType
pub fn i16() -> DataType
pub fn i32() -> DataType
pub fn i64() -> DataType
pub fn u8() -> DataType
pub fn u16() -> DataType
pub fn u32() -> DataType
pub fn u64() -> DataType
pub fn float(bits: u8, lanes: u16) -> DataType
pub fn f32() -> DataType
pub fn f64() -> DataType
sourcepub fn opaque_handle(bits: u8, lanes: u16) -> DataType
pub fn opaque_handle(bits: u8, lanes: u16) -> DataType
Opaque handle type.
Trait Implementations
sourceimpl From<DLDataType> for DataType
impl From<DLDataType> for DataType
sourcefn from(dtype: DLDataType) -> Self
fn from(dtype: DLDataType) -> Self
Converts to this type from the input type.
sourceimpl From<DataType> for DLDataType
impl From<DataType> for DLDataType
impl Copy for DataType
impl Eq for DataType
impl StructuralEq for DataType
impl StructuralPartialEq for DataType
Auto Trait Implementations
impl RefUnwindSafe for DataType
impl Send for DataType
impl Sync for DataType
impl Unpin for DataType
impl UnwindSafe for DataType
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more