pub struct DequantizePerTensorBackwardPlan<TIn: Element, TOut: IntElement> { /* private fields */ }Expand description
dequantize_per_tensor backward plan.
Straight-through. The dequant FW is exactly linear in the int
input (x = scale * (q - zp)), so dq = scale * dy. The int
input itself is non-differentiable; this BW propagates the
upstream gradient back into FP-typed d_input for autograd
continuity.
When to use: backward for
DequantizePerTensorPlan.
Dtypes: gradients in {f32, f64, f16, bf16}; TOut carried
for SKU parity with the FW Plan.
Shape limits: flat [numel].
Workspace: none.
Precision guarantee: deterministic, bit-stable.
Implementations§
Source§impl<TIn: Element, TOut: IntElement> DequantizePerTensorBackwardPlan<TIn, TOut>
impl<TIn: Element, TOut: IntElement> DequantizePerTensorBackwardPlan<TIn, TOut>
Sourcepub fn select(
_stream: &Stream,
desc: &DequantizePerTensorBackwardDescriptor,
_pref: PlanPreference,
) -> Result<Self>
pub fn select( _stream: &Stream, desc: &DequantizePerTensorBackwardDescriptor, _pref: PlanPreference, ) -> Result<Self>
Pick a kernel.
Sourcepub fn can_implement(
&self,
args: &DequantizePerTensorBackwardArgs<'_, TIn, TOut>,
) -> Result<()>
pub fn can_implement( &self, args: &DequantizePerTensorBackwardArgs<'_, 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 DequantizePerTensorBackwardPlan<TIn, TOut>
impl<TIn, TOut> RefUnwindSafe for DequantizePerTensorBackwardPlan<TIn, TOut>where
TIn: RefUnwindSafe,
TOut: RefUnwindSafe,
impl<TIn, TOut> Send for DequantizePerTensorBackwardPlan<TIn, TOut>
impl<TIn, TOut> Sync for DequantizePerTensorBackwardPlan<TIn, TOut>
impl<TIn, TOut> Unpin for DequantizePerTensorBackwardPlan<TIn, TOut>
impl<TIn, TOut> UnsafeUnpin for DequantizePerTensorBackwardPlan<TIn, TOut>
impl<TIn, TOut> UnwindSafe for DequantizePerTensorBackwardPlan<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