pub struct QuantizationParametersPrimitive<B: Backend> {
pub scales: B::FloatTensorPrimitive,
pub global: Option<B::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::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::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>where
<B as BackendTypes>::FloatTensorPrimitive: Freeze,
Option<<B as BackendTypes>::FloatTensorPrimitive>: Freeze,
impl<B> RefUnwindSafe for QuantizationParametersPrimitive<B>where
<B as BackendTypes>::FloatTensorPrimitive: RefUnwindSafe,
Option<<B as BackendTypes>::FloatTensorPrimitive>: RefUnwindSafe,
impl<B> Send for QuantizationParametersPrimitive<B>where
<B as BackendTypes>::FloatTensorPrimitive: Send,
Option<<B as BackendTypes>::FloatTensorPrimitive>: Send,
impl<B> Sync for QuantizationParametersPrimitive<B>where
<B as BackendTypes>::FloatTensorPrimitive: Sync,
Option<<B as BackendTypes>::FloatTensorPrimitive>: Sync,
impl<B> Unpin for QuantizationParametersPrimitive<B>where
<B as BackendTypes>::FloatTensorPrimitive: Unpin,
Option<<B as BackendTypes>::FloatTensorPrimitive>: Unpin,
impl<B> UnsafeUnpin for QuantizationParametersPrimitive<B>where
<B as BackendTypes>::FloatTensorPrimitive: UnsafeUnpin,
Option<<B as BackendTypes>::FloatTensorPrimitive>: UnsafeUnpin,
impl<B> UnwindSafe for QuantizationParametersPrimitive<B>where
<B as BackendTypes>::FloatTensorPrimitive: UnwindSafe,
Option<<B as BackendTypes>::FloatTensorPrimitive>: 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