pub struct GridSamplePlan<T: Element> { /* private fields */ }Expand description
grid_sample plan.
Sample an NCHW input at arbitrary normalized (x, y) coordinates
supplied via grid: [N, OH, OW, 2] (PyTorch F.grid_sample).
Trailblazer config matches PyTorch defaults: mode='bilinear',
padding_mode='zeros', align_corners=false.
When to use: forward 2-D grid sample. Pair with
GridSampleBackwardPlan.
Dtypes: {f32, f64}.
Shape limits: rank-4 NCHW input; rank-4 grid [N, OH, OW, 2];
output [N, C, OH, OW].
Workspace: none.
Precision guarantee: deterministic, bit-stable.
Implementations§
Source§impl<T: Element> GridSamplePlan<T>
impl<T: Element> GridSamplePlan<T>
Sourcepub fn select(
_stream: &Stream,
desc: &GridSampleDescriptor,
_pref: PlanPreference,
) -> Result<Self>
pub fn select( _stream: &Stream, desc: &GridSampleDescriptor, _pref: PlanPreference, ) -> Result<Self>
Pick a kernel.
Sourcepub fn can_implement(&self, args: &GridSampleArgs<'_, T>) -> Result<()>
pub fn can_implement(&self, args: &GridSampleArgs<'_, 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 GridSamplePlan<T>
impl<T> RefUnwindSafe for GridSamplePlan<T>where
T: RefUnwindSafe,
impl<T> Send for GridSamplePlan<T>where
T: Send,
impl<T> Sync for GridSamplePlan<T>where
T: Sync,
impl<T> Unpin for GridSamplePlan<T>where
T: Unpin,
impl<T> UnsafeUnpin for GridSamplePlan<T>
impl<T> UnwindSafe for GridSamplePlan<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