pub struct InterpolatePlan<T: Element> { /* private fields */ }Expand description
interpolate plan.
Spatial resample of an NCHW input. PyTorch F.interpolate.
Coordinate mapping: src = (dst + 0.5) * (src_size / dst_size) - 0.5
(align_corners=false); corner samples clamp to the input
boundary.
When to use: forward 2-D bilinear resample. Pair with
InterpolateBackwardPlan for
autograd.
Dtypes: {f32, f64, f16, bf16}.
Shape limits: rank-4 NCHW input [N, C, IH, IW]; output
[N, C, OH, OW]; all extents non-negative.
Modes: only Bilinear2d is wired in the trailblazer.
Nearest2d / Bicubic2d / Trilinear3d / Linear1d / Area2d
are reserved on the enum and return Unsupported.
Workspace: none.
Precision guarantee: deterministic, bit-stable on identical hardware. No atomics on FW.
Implementations§
Source§impl<T: Element> InterpolatePlan<T>
impl<T: Element> InterpolatePlan<T>
Sourcepub fn select(
_stream: &Stream,
desc: &InterpolateDescriptor,
_pref: PlanPreference,
) -> Result<Self>
pub fn select( _stream: &Stream, desc: &InterpolateDescriptor, _pref: PlanPreference, ) -> Result<Self>
Pick a kernel for desc.
Sourcepub fn can_implement(&self, args: &InterpolateArgs<'_, T>) -> Result<()>
pub fn can_implement(&self, args: &InterpolateArgs<'_, T>) -> Result<()>
Validate args.
Sourcepub fn workspace_size(&self) -> usize
pub fn workspace_size(&self) -> usize
Workspace size (zero).
Sourcepub fn precision_guarantee(&self) -> PrecisionGuarantee
pub fn precision_guarantee(&self) -> PrecisionGuarantee
Numerical guarantees for this plan’s kernel.