pub struct QuantizePerGroupDescriptor {
pub outer_size: i32,
pub axis_size: i32,
pub group_size: i32,
pub q_min: i32,
pub q_max: i32,
pub input_element: ElementKind,
pub output_element: ElementKind,
}Expand description
Descriptor for a quantize_per_group forward op.
Fields§
§outer_size: i32Product of all dims except the quant axis (the flattened non-quant prefix).
axis_size: i32Length of the quant axis. Must be >= 0 and divisible by
group_size.
group_size: i32Group size — number of consecutive elements along the quant
axis that share a (scale, zp) pair. Typical: 128 for GPTQ
INT4 weights.
q_min: i32Quantization range lower bound.
q_max: i32Quantization range upper bound.
input_element: ElementKindInput FP element kind.
output_element: ElementKindOutput int element kind.
Implementations§
Source§impl QuantizePerGroupDescriptor
impl QuantizePerGroupDescriptor
Sourcepub fn num_groups(&self) -> i32
pub fn num_groups(&self) -> i32
Number of groups along the quant axis. Equals
axis_size / group_size (validated axis_size % group_size == 0).
Trait Implementations§
Source§impl Clone for QuantizePerGroupDescriptor
impl Clone for QuantizePerGroupDescriptor
Source§fn clone(&self) -> QuantizePerGroupDescriptor
fn clone(&self) -> QuantizePerGroupDescriptor
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 moreimpl Copy for QuantizePerGroupDescriptor
Auto Trait Implementations§
impl Freeze for QuantizePerGroupDescriptor
impl RefUnwindSafe for QuantizePerGroupDescriptor
impl Send for QuantizePerGroupDescriptor
impl Sync for QuantizePerGroupDescriptor
impl Unpin for QuantizePerGroupDescriptor
impl UnsafeUnpin for QuantizePerGroupDescriptor
impl UnwindSafe for QuantizePerGroupDescriptor
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