Enum safetensors::tensor::Dtype
source · #[non_exhaustive]pub enum Dtype {
Show 15 variants
BOOL,
U8,
I8,
F8_E5M2,
F8_E4M3,
I16,
U16,
F16,
BF16,
I32,
U32,
F32,
F64,
I64,
U64,
}
Expand description
The various available dtypes. They MUST be in increasing alignment order
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
BOOL
Boolan type
U8
Unsigned byte
I8
Signed byte
F8_E5M2
F8_E4M3
I16
Signed integer (16-bit)
U16
Unsigned integer (16-bit)
F16
Half-precision floating point
BF16
Brain floating point
I32
Signed integer (32-bit)
U32
Unsigned integer (32-bit)
F32
Floating point (32-bit)
F64
Floating point (64-bit)
I64
Signed integer (64-bit)
U64
Unsigned integer (64-bit)
Implementations§
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
source§impl Ord for Dtype
impl Ord for Dtype
source§impl PartialEq for Dtype
impl PartialEq for Dtype
source§impl PartialOrd for Dtype
impl PartialOrd for Dtype
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl 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