pub enum DType {
Show 23 variants
I8,
I16,
F32,
F64,
U8,
U16,
I32,
I64,
U32,
U64,
Bool,
Bitset,
F16,
BF16,
F8,
I4,
I2,
I1,
U4,
U2,
U1,
T2,
T1,
}Expand description
Supported element dtypes.
Variants§
Implementations§
Source§impl DType
impl DType
Sourcepub fn from_ident(ident: &str) -> Result<Self>
pub fn from_ident(ident: &str) -> Result<Self>
Parse a dtype from its identifier string.
Sourcepub fn is_universal(self) -> bool
pub fn is_universal(self) -> bool
True if the dtype is supported across all backends.
Sourcepub fn is_signed_int(self) -> bool
pub fn is_signed_int(self) -> bool
True if the dtype is a signed integer type.
Sourcepub fn is_packed_signed(self) -> bool
pub fn is_packed_signed(self) -> bool
True if the dtype is a packed signed integer type.
Sourcepub fn storage_len(self, logical_len: usize) -> usize
pub fn storage_len(self, logical_len: usize) -> usize
Storage length in elements for a logical length.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for DType
impl<'de> Deserialize<'de> for DType
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for DType
impl Eq for DType
impl StructuralPartialEq for DType
Auto Trait Implementations§
impl Freeze for DType
impl RefUnwindSafe for DType
impl Send for DType
impl Sync for DType
impl Unpin for DType
impl UnwindSafe for DType
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more