pub struct QuantizedLinear4BitSpec {
pub in_dim: u32,
pub out_dim: u32,
pub weight_type: DataType,
}Expand description
Typed metadata for fused grouped INT4 linear.
The actual packed weight buffer is still addressed as u32 words because
the kernel extracts eight nibbles per word. This spec binds that physical
layout to the first-class DataType::Quantized contract so call sites do
not pass an untyped integer buffer and lose the scale/zero-point semantics.
Fields§
§in_dim: u32Input feature dimension.
out_dim: u32Output feature dimension.
weight_type: DataTypeFirst-class quantized weight metadata.
Implementations§
Source§impl QuantizedLinear4BitSpec
impl QuantizedLinear4BitSpec
Sourcepub fn affine_grouped(in_dim: u32, out_dim: u32, group_size: u32) -> Self
pub fn affine_grouped(in_dim: u32, out_dim: u32, group_size: u32) -> Self
Build a grouped affine INT4 metadata spec.
Trait Implementations§
Source§impl Clone for QuantizedLinear4BitSpec
impl Clone for QuantizedLinear4BitSpec
Source§fn clone(&self) -> QuantizedLinear4BitSpec
fn clone(&self) -> QuantizedLinear4BitSpec
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 QuantizedLinear4BitSpec
impl Debug for QuantizedLinear4BitSpec
impl Eq for QuantizedLinear4BitSpec
Source§impl PartialEq for QuantizedLinear4BitSpec
impl PartialEq for QuantizedLinear4BitSpec
impl StructuralPartialEq for QuantizedLinear4BitSpec
Auto Trait Implementations§
impl Freeze for QuantizedLinear4BitSpec
impl RefUnwindSafe for QuantizedLinear4BitSpec
impl Send for QuantizedLinear4BitSpec
impl Sync for QuantizedLinear4BitSpec
impl Unpin for QuantizedLinear4BitSpec
impl UnsafeUnpin for QuantizedLinear4BitSpec
impl UnwindSafe for QuantizedLinear4BitSpec
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,
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.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