pub struct QuantizationParametersPrimitive<B: Backend> {
pub scale: B::FloatTensorPrimitive<1>,
pub offset: Option<B::IntTensorPrimitive<1>>,
}
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::FloatTensorPrimitive<1>
The scaling factor.
offset: Option<B::IntTensorPrimitive<1>>
The zero-point offset.
Trait Implementations§
source§impl<B: Backend> From<QuantizationParameters<B>> for QuantizationParametersPrimitive<B>
impl<B: Backend> From<QuantizationParameters<B>> for QuantizationParametersPrimitive<B>
source§fn from(value: QuantizationParameters<B>) -> Self
fn from(value: QuantizationParameters<B>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<B> Freeze for QuantizationParametersPrimitive<B>where
<B as Backend>::FloatTensorPrimitive<1>: Freeze,
<B as Backend>::IntTensorPrimitive<1>: Freeze,
impl<B> RefUnwindSafe for QuantizationParametersPrimitive<B>where
<B as Backend>::FloatTensorPrimitive<1>: RefUnwindSafe,
<B as Backend>::IntTensorPrimitive<1>: 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<1>: UnwindSafe,
<B as Backend>::IntTensorPrimitive<1>: 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