pub enum DType {
E2M1,
FP8E4M3,
FP8E5M2,
BF16,
FP16,
FP32,
}Expand description
2026-09-25: Element type of a weight or scale tensor; the width is
DType::element_size_bits.
Variants§
E2M1
2026-09-25: 4-bit float, 1 sign + 2 exponent + 1 mantissa bits; the
weight type of QuantConfig::nvfp4.
FP8E4M3
2026-09-25: 8-bit float, 1 sign + 4 exponent + 3 mantissa bits; the
block-scale type of QuantConfig::nvfp4 and the weight type of
QuantConfig::fp8.
FP8E5M2
2026-09-25: 8-bit float, 1 sign + 5 exponent + 2 mantissa bits.
BF16
FP16
FP32
Implementations§
Source§impl DType
impl DType
Sourcepub const fn element_size_bits(&self) -> usize
pub const fn element_size_bits(&self) -> usize
2026-09-25: Width of one element in bits (4 for E2M1).
pub const fn elements_per_u32(&self) -> usize
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.