Autograd node for 3-D trilinear interpolation.
Resizes a 5-D tensor of shape (N, C, D_in, H_in, W_in) to
(N, C, D_out, H_out, W_out) by linearly interpolating between the
eight neighbouring input voxels. Conceptually the trilinear weights are
the product of three 1-D linear weights (one per spatial axis), giving
where the per-axis source coordinates follow the same align_corners rule
described in the file header.
Math
Output size formula (per axis ):
Attributes
schema_v1OpSchema"interpolate_trilinear", AmpPolicy::Promote.D_in_, H_in_, W_in_intSaved input spatial dimensions.
D_out_, H_out_, W_out_intRequested output spatial dimensions.
align_corners_boolCoordinate mapping mode.
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, bool align_corners)Compute the trilinear 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.
align_cornersboolCoordinate mapping mode.
Returns
TensorImplPtrResampled tensor of shape (N, C, D_out, H_out, W_out).
Raises
ShapeMismatchIf
input is not 5-D.