pub struct DequantizePerTensorPlan<TIn: Element, TOut: IntElement> { /* private fields */ }Expand description
dequantize_per_tensor plan.
x = scale * (q - zero_point). Linear; exactly invertible (up to
FW rounding) against QuantizePerTensorPlan.
When to use: FP recovery from a per-tensor-quantized buffer.
Pair with DequantizePerTensorBackwardPlan
for autograd through the dequant op.
Dtypes: input int {s8, u8} (= TOut); output FP
{f32, f64, f16, bf16} (= TIn).
Shape limits: flat [numel].
Workspace: none.
Precision guarantee: deterministic, bit-stable.
Implementations§
Source§impl<TIn: Element, TOut: IntElement> DequantizePerTensorPlan<TIn, TOut>
impl<TIn: Element, TOut: IntElement> DequantizePerTensorPlan<TIn, TOut>
Sourcepub fn select(
_stream: &Stream,
desc: &DequantizePerTensorDescriptor,
_pref: PlanPreference,
) -> Result<Self>
pub fn select( _stream: &Stream, desc: &DequantizePerTensorDescriptor, _pref: PlanPreference, ) -> Result<Self>
Pick a kernel.
Sourcepub fn can_implement(
&self,
args: &DequantizePerTensorArgs<'_, TIn, TOut>,
) -> Result<()>
pub fn can_implement( &self, args: &DequantizePerTensorArgs<'_, TIn, TOut>, ) -> Result<()>
Validate args.
Sourcepub fn workspace_size(&self) -> usize
pub fn workspace_size(&self) -> usize
Workspace bytes.
Sourcepub fn precision_guarantee(&self) -> PrecisionGuarantee
pub fn precision_guarantee(&self) -> PrecisionGuarantee
Numerical guarantees.
Auto Trait Implementations§
impl<TIn, TOut> Freeze for DequantizePerTensorPlan<TIn, TOut>
impl<TIn, TOut> RefUnwindSafe for DequantizePerTensorPlan<TIn, TOut>where
TIn: RefUnwindSafe,
TOut: RefUnwindSafe,
impl<TIn, TOut> Send for DequantizePerTensorPlan<TIn, TOut>
impl<TIn, TOut> Sync for DequantizePerTensorPlan<TIn, TOut>
impl<TIn, TOut> Unpin for DequantizePerTensorPlan<TIn, TOut>
impl<TIn, TOut> UnsafeUnpin for DequantizePerTensorPlan<TIn, TOut>
impl<TIn, TOut> UnwindSafe for DequantizePerTensorPlan<TIn, TOut>where
TIn: UnwindSafe,
TOut: 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