pub struct QuantizationParametersPrimitive<B>where
B: Backend,{
pub scale: <B as Backend>::FloatTensorPrimitive,
pub offset: Option<<B as Backend>::IntTensorPrimitive>,
}
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.
Users should prefer the QuantizationParameters struct, which is designed for public use.
Fields§
§scale: <B as Backend>::FloatTensorPrimitive
The scaling factor.
offset: Option<<B as Backend>::IntTensorPrimitive>
The zero-point offset.
Trait Implementations§
§impl<B> From<QuantizationParameters<B>> for QuantizationParametersPrimitive<B>where
B: Backend,
impl<B> From<QuantizationParameters<B>> for QuantizationParametersPrimitive<B>where
B: Backend,
§fn from(value: QuantizationParameters<B>) -> QuantizationParametersPrimitive<B>
fn from(value: QuantizationParameters<B>) -> QuantizationParametersPrimitive<B>
Converts to this type from the input type.
§impl<B> From<QuantizationParametersPrimitive<Fusion<B>>> for FusionQuantizationParameters<<B as FusionBackend>::FusionRuntime>where
B: FusionBackend,
impl<B> From<QuantizationParametersPrimitive<Fusion<B>>> for FusionQuantizationParameters<<B as FusionBackend>::FusionRuntime>where
B: FusionBackend,
§fn from(
value: QuantizationParametersPrimitive<Fusion<B>>,
) -> FusionQuantizationParameters<<B as FusionBackend>::FusionRuntime>
fn from( value: QuantizationParametersPrimitive<Fusion<B>>, ) -> FusionQuantizationParameters<<B as FusionBackend>::FusionRuntime>
Converts to this type from the input type.
Auto Trait Implementations§
impl<B> Freeze for QuantizationParametersPrimitive<B>
impl<B> RefUnwindSafe for QuantizationParametersPrimitive<B>where
<B as Backend>::FloatTensorPrimitive: RefUnwindSafe,
<B as Backend>::IntTensorPrimitive: RefUnwindSafe,
impl<B> Send for QuantizationParametersPrimitive<B>
impl<B> Sync for QuantizationParametersPrimitive<B>
impl<B> Unpin for QuantizationParametersPrimitive<B>
impl<B> UnwindSafe for QuantizationParametersPrimitive<B>where
<B as Backend>::FloatTensorPrimitive: UnwindSafe,
<B as Backend>::IntTensorPrimitive: UnwindSafe,
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<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