Struct QuantizationParametersPrimitive
pub struct QuantizationParametersPrimitive<B>where
B: Backend,{
pub scales: <B as BackendTypes>::FloatTensorPrimitive,
pub global: Option<<B as BackendTypes>::FloatTensorPrimitive>,
}Expand description
The quantization parameters primitive.
§Remarks
This is a low-level struct used internally by the library to provide the quantization parameters to the backends. It is not designed for direct usage by users, and not recommended to import or use this struct directly.
Fields§
§scales: <B as BackendTypes>::FloatTensorPrimitiveThe scaling factor, one per block or a single one for a per-tensor level, in the quantized tensor’s float dtype.
global: Option<<B as BackendTypes>::FloatTensorPrimitive>The per-tensor scale that scales are expressed relative to, for a
two-level scheme. Always f32, unlike scales, so the two cannot go into a binary op
without a cast.
Auto Trait Implementations§
impl<B> Freeze for QuantizationParametersPrimitive<B>
impl<B> RefUnwindSafe for QuantizationParametersPrimitive<B>
impl<B> Send for QuantizationParametersPrimitive<B>
impl<B> Sync for QuantizationParametersPrimitive<B>
impl<B> Unpin for QuantizationParametersPrimitive<B>
impl<B> UnsafeUnpin for QuantizationParametersPrimitive<B>
impl<B> UnwindSafe for QuantizationParametersPrimitive<B>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<K, Q> Comparable<Q> for K
impl<K, Q> Comparable<Q> for K
§impl<K, Q> Equivalent<Q> for K
impl<K, Q> Equivalent<Q> for K
§fn equivalent(&self, key: &Q) -> bool
fn equivalent(&self, key: &Q) -> bool
Compare self to
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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