pub struct BlockLayout {
pub elements: u16,
pub block_bytes: u16,
pub element: Coded,
pub multiplier: i16,
pub scale: Field,
pub min: Option<Field>,
pub min_multiplier: i8,
pub sub: Option<SubBlocks>,
}Expand description
The packing of one block of elements codes under a shared scale.
Fields§
§elements: u16Elements per block; 32 for Q4_0, 256 for the K formats.
block_bytes: u16Bytes per block; 18 for Q4_0, 144 for Q4_K.
element: CodedThe element code; its bias is the offset-binary bias (8 for Q4_0, 32 for Q6_K).
multiplier: i16Multiplies the code before the bias: 2 for Q1_0, whose value is (2 * code - 1) * scale.
scale: Field§min: Option<Field>§min_multiplier: i8Applied to the min term: 1 where the min is added (Q4_1), -1 where it is subtracted (Q4_K).
sub: Option<SubBlocks>Implementations§
Source§impl BlockLayout
impl BlockLayout
pub const Q4_0: Self
pub const Q4_1: Self
pub const Q5_0: Self
pub const Q5_1: Self
pub const Q8_0: Self
pub const Q8_1: Self
pub const Q1_0: Self
pub const Q2_0: Self
pub const Q2_K: Self
pub const Q3_K: Self
pub const Q4_K: Self
pub const Q5_K: Self
pub const Q6_K: Self
pub const Q8_K: Self
Trait Implementations§
Source§impl Clone for BlockLayout
impl Clone for BlockLayout
impl Copy for BlockLayout
Source§impl Debug for BlockLayout
impl Debug for BlockLayout
Source§impl<'de> Deserialize<'de> for BlockLayout
impl<'de> Deserialize<'de> for BlockLayout
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 Eq for BlockLayout
Source§impl Hash for BlockLayout
impl Hash for BlockLayout
Source§impl PartialEq for BlockLayout
impl PartialEq for BlockLayout
Source§impl Serialize for BlockLayout
impl Serialize for BlockLayout
impl StructuralPartialEq for BlockLayout
Auto Trait Implementations§
impl Freeze for BlockLayout
impl RefUnwindSafe for BlockLayout
impl Send for BlockLayout
impl Sync for BlockLayout
impl Unpin for BlockLayout
impl UnsafeUnpin for BlockLayout
impl UnwindSafe for BlockLayout
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<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.