pub struct DataType { /* private fields */ }Expand description
Scalar category, bit width, and vector lane count.
Implementations§
Source§impl DataType
impl DataType
Sourcepub fn try_new(
code: DataTypeCode,
bits: u8,
lanes: u16,
) -> Result<Self, TensorError>
pub fn try_new( code: DataTypeCode, bits: u8, lanes: u16, ) -> Result<Self, TensorError>
Creates a byte-addressable scalar or vector data type.
Sourcepub const fn code(self) -> DataTypeCode
pub const fn code(self) -> DataTypeCode
Returns the scalar category.
Sourcepub fn element_size(self) -> usize
pub fn element_size(self) -> usize
Returns bytes occupied by one tensor element.
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