pub struct GridSampleBackwardPlan<T: Element> { /* private fields */ }Expand description
grid_sample_backward plan.
Adjoint of crate::GridSamplePlan: scatter dout into both
dinput (4 bilinear weights via atomicAdd) and dgrid (analytic
chain rule through the coordinate mapping).
When to use: BW for GridSamplePlan.
Caller retains FW input and grid.
Dtypes: {f32, f64}.
Shape limits: rank-4 NCHW + grid [N, OH, OW, 2].
Workspace: none. Caller MUST zero dinput and dgrid before
launch.
Precision guarantee: non-deterministic (atomicAdd into
dinput).
Implementations§
Source§impl<T: Element> GridSampleBackwardPlan<T>
impl<T: Element> GridSampleBackwardPlan<T>
Sourcepub fn select(
_stream: &Stream,
desc: &GridSampleBackwardDescriptor,
_pref: PlanPreference,
) -> Result<Self>
pub fn select( _stream: &Stream, desc: &GridSampleBackwardDescriptor, _pref: PlanPreference, ) -> Result<Self>
Pick a kernel.
Sourcepub fn can_implement(&self, args: &GridSampleBackwardArgs<'_, T>) -> Result<()>
pub fn can_implement(&self, args: &GridSampleBackwardArgs<'_, T>) -> Result<()>
Validate args.
Sourcepub fn workspace_size(&self) -> usize
pub fn workspace_size(&self) -> usize
Workspace (zero).
Sourcepub fn precision_guarantee(&self) -> PrecisionGuarantee
pub fn precision_guarantee(&self) -> PrecisionGuarantee
Numerical guarantees.
Auto Trait Implementations§
impl<T> Freeze for GridSampleBackwardPlan<T>
impl<T> RefUnwindSafe for GridSampleBackwardPlan<T>where
T: RefUnwindSafe,
impl<T> Send for GridSampleBackwardPlan<T>where
T: Send,
impl<T> Sync for GridSampleBackwardPlan<T>where
T: Sync,
impl<T> Unpin for GridSampleBackwardPlan<T>where
T: Unpin,
impl<T> UnsafeUnpin for GridSampleBackwardPlan<T>
impl<T> UnwindSafe for GridSampleBackwardPlan<T>where
T: 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