pub enum Granularity {
PerTensor,
PerChannel {
axis: usize,
},
Group {
axis: usize,
group_size: usize,
},
}Expand description
Quantization granularity: how a tensor’s elements are partitioned into groups that each get their own scale/zero-point.
Variants§
PerTensor
One scale/zero-point for the whole tensor.
PerChannel
One scale/zero-point per index along axis (e.g. per output channel of a Linear or
Conv weight). Equivalent to Granularity::Group with group_size: 1.
Group
One scale/zero-point per contiguous group_size-element block along axis (the
GPTQ/AWQ/compressed-tensors convention; axis is typically the reduction/input-channel
axis).
Implementations§
Source§impl Granularity
impl Granularity
Sourcepub fn strategy_name(self) -> &'static str
pub fn strategy_name(self) -> &'static str
A short, stable name for the compressed-tensors strategy field.
Trait Implementations§
Source§impl Clone for Granularity
impl Clone for Granularity
Source§fn clone(&self) -> Granularity
fn clone(&self) -> Granularity
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Granularity
impl Debug for Granularity
Source§impl PartialEq for Granularity
impl PartialEq for Granularity
Source§fn eq(&self, other: &Granularity) -> bool
fn eq(&self, other: &Granularity) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for Granularity
impl Eq for Granularity
impl StructuralPartialEq for Granularity
Auto Trait Implementations§
impl Freeze for Granularity
impl RefUnwindSafe for Granularity
impl Send for Granularity
impl Sync for Granularity
impl Unpin for Granularity
impl UnsafeUnpin for Granularity
impl UnwindSafe for Granularity
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.