Autograd node for 3-D nearest-neighbour interpolation.
Volumetric counterpart of InterpolateNearestBackward2D; resizes a 5-D
tensor (N, C, D_in, H_in, W_in) to (N, C, D_out, H_out, W_out) by
floor-rounding source voxel coordinates. The backward scatter-adds each
output gradient onto its unique source voxel.
Attributes
schema_v1OpSchema"interpolate_nearest_3d", AmpPolicy::KeepInput.D_in_, H_in_, W_in_intSaved input spatial dimensions.
D_out_, H_out_, W_out_intRequested output spatial dimensions.
orig_shape_ShapeFull
(N, C, D_in, H_in, W_in) shape for backward reconstruction.Static methods
1static
forward
→TensorImplPtrint forward(const int & input, int D_out, int H_out, int W_out)Compute the nearest-neighbour resize with autograd wiring.
Parameters
inputTensorImplPtr5-D input tensor of shape
(N, C, D_in, H_in, W_in).D_outintDesired output depth.
H_outintDesired output height.
W_outintDesired output width.
Returns
TensorImplPtrResampled tensor of shape (N, C, D_out, H_out, W_out).
Raises
ShapeMismatchIf
input is not 5-D.