pub struct QuantizePerTensorArgs<'a, TIn: Element, TOut: IntElement> {
pub input: TensorRef<'a, TIn, 1>,
pub scale: <TIn as Element>::Scalar,
pub zero_point: i32,
pub output: TensorMut<'a, TOut, 1>,
}Expand description
Args bundle for a quantize_per_tensor forward launch.
The input / output tensors are 1-D for the trailblazer — the caller
flattens a multi-D tensor down to its numel (per-tensor quantization
is axis-agnostic). The 1-D shape is [numel].
Fields§
§input: TensorRef<'a, TIn, 1>Input tensor in FP. Flat [numel].
scale: <TIn as Element>::ScalarScalar scale (FP), passed by value. The plan converts to the
appropriate FFI scalar (f32 or f64) based on TIn.
zero_point: i32Scalar zero point (i32), passed by value.
output: TensorMut<'a, TOut, 1>Output tensor in int. Flat [numel].
Auto Trait Implementations§
impl<'a, TIn, TOut> !UnwindSafe for QuantizePerTensorArgs<'a, TIn, TOut>
impl<'a, TIn, TOut> Freeze for QuantizePerTensorArgs<'a, TIn, TOut>
impl<'a, TIn, TOut> RefUnwindSafe for QuantizePerTensorArgs<'a, TIn, TOut>
impl<'a, TIn, TOut> Send for QuantizePerTensorArgs<'a, TIn, TOut>
impl<'a, TIn, TOut> Sync for QuantizePerTensorArgs<'a, TIn, TOut>
impl<'a, TIn, TOut> Unpin for QuantizePerTensorArgs<'a, TIn, TOut>
impl<'a, TIn, TOut> UnsafeUnpin for QuantizePerTensorArgs<'a, TIn, TOut>
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