Skip to main content

QuantizePerTensorBackwardArgs

Struct QuantizePerTensorBackwardArgs 

Source
pub struct QuantizePerTensorBackwardArgs<'a, TIn: Element, TOut: IntElement> {
    pub input: TensorRef<'a, TIn, 1>,
    pub scale: <TIn as Element>::Scalar,
    pub zero_point: i32,
    pub d_output: TensorRef<'a, TIn, 1>,
    pub d_input: TensorMut<'a, TIn, 1>,
    pub _phantom: PhantomData<TOut>,
}
Expand description

Args bundle for a quantize_per_tensor backward launch.

Fields§

§input: TensorRef<'a, TIn, 1>

Saved FW input [numel] in FP — required for mask recomputation.

§scale: <TIn as Element>::Scalar

Scalar scale (FP, same value used in FW).

§zero_point: i32

Scalar zero point (same value used in FW).

§d_output: TensorRef<'a, TIn, 1>

Upstream gradient [numel] in FP.

§d_input: TensorMut<'a, TIn, 1>

Output [numel] in FP — same dtype as d_output.

§_phantom: PhantomData<TOut>

Phantom for the int-output dtype carried by the plan type parameter (so the BW plan has the same <TIn, TOut> shape as the FW plan, even though the BW kernel doesn’t consume an int operand).

Auto Trait Implementations§

§

impl<'a, TIn, TOut> !UnwindSafe for QuantizePerTensorBackwardArgs<'a, TIn, TOut>

§

impl<'a, TIn, TOut> Freeze for QuantizePerTensorBackwardArgs<'a, TIn, TOut>
where <TIn as Element>::Scalar: Freeze,

§

impl<'a, TIn, TOut> RefUnwindSafe for QuantizePerTensorBackwardArgs<'a, TIn, TOut>
where <TIn as Element>::Scalar: RefUnwindSafe, TOut: RefUnwindSafe, TIn: RefUnwindSafe,

§

impl<'a, TIn, TOut> Send for QuantizePerTensorBackwardArgs<'a, TIn, TOut>
where <TIn as Element>::Scalar: Send, TOut: Send, TIn: Sync + Send,

§

impl<'a, TIn, TOut> Sync for QuantizePerTensorBackwardArgs<'a, TIn, TOut>
where <TIn as Element>::Scalar: Sync, TOut: Sync, TIn: Sync,

§

impl<'a, TIn, TOut> Unpin for QuantizePerTensorBackwardArgs<'a, TIn, TOut>
where <TIn as Element>::Scalar: Unpin, TOut: Unpin,

§

impl<'a, TIn, TOut> UnsafeUnpin for QuantizePerTensorBackwardArgs<'a, TIn, TOut>
where <TIn as Element>::Scalar: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.