pub enum DType {
Show 32 variants
F32,
F16,
BF16,
F64,
I8,
I16,
I32,
I64,
U8,
Q4_0,
Q4_1,
Q5_0,
Q5_1,
Q8_0,
Q8_1,
Q2K,
Q3K,
Q4K,
Q5K,
Q6K,
Q8K,
IQ2XXS,
IQ2XS,
IQ2S,
IQ3XXS,
IQ3S,
IQ4XS,
IQ4NL,
IQ1S,
IQ1M,
TQ1_0,
TQ2_0,
}Expand description
Data type for tensor elements
Variants§
F32
F16
BF16
F64
I8
I16
I32
I64
U8
Q4_0
Q4_1
Q5_0
Q5_1
Q8_0
Q8_1
Q2K
Q3K
Q4K
Q5K
Q6K
Q8K
IQ2XXS
IQ2XS
IQ2S
IQ3XXS
IQ3S
IQ4XS
IQ4NL
IQ1S
IQ1M
TQ1_0
TQ2_0
Implementations§
Source§impl DType
impl DType
Sourcepub const fn block_size(&self) -> usize
pub const fn block_size(&self) -> usize
Block size for this type (number of elements per block)
Sourcepub const fn block_bytes(&self) -> usize
pub const fn block_bytes(&self) -> usize
Bytes per block for this type
Sourcepub const fn is_quantized(&self) -> bool
pub const fn is_quantized(&self) -> bool
Returns true if this is a quantized type
Sourcepub const fn size_for_elements(&self, n_elements: usize) -> usize
pub const fn size_for_elements(&self, n_elements: usize) -> usize
Calculate the byte size needed for a given number of elements
Trait Implementations§
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 UnsafeUnpin 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<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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