Upsamples a given multi-channel 1D (temporal), 2D (spatial) or 3D (volumetric) data.
The input data is assumed to be of the form
minibatch x channels x [optional depth] x [optional height] x width.
Hence, for spatial inputs, we expect a 4D Tensor and for volumetric inputs, we expect a 5D Tensor.
The algorithms available for upsampling are nearest neighbor and linear,
bilinear, bicubic and trilinear for 3D, 4D and 5D input Tensor,
respectively.
One can either give a scale_factor or the target output size to
calculate the output size. (You cannot give both, as it is ambiguous)
Parameters:
size (int or Tuple[int] or Tuple[int, int] or Tuple[int, int, int], optional) – output spatial sizes
scale_factor (float or Tuple[float] or Tuple[float, float] or Tuple[float, float, float], optional) – multiplier for spatial size. Has to match input size if it is a tuple.
mode (str, optional) – the upsampling algorithm: one of 'nearest',
'linear', 'bilinear', 'bicubic' and 'trilinear'.
Default: 'nearest'
align_corners (bool, optional) – if True, the corner pixels of the input
and output tensors are aligned, and thus preserving the values at
those pixels. This only has effect when mode is
'linear', 'bilinear', 'bicubic', or 'trilinear'.
Default: False
recompute_scale_factor (bool, optional) – recompute the scale_factor for use in the
interpolation calculation. If recompute_scale_factor is True, then
scale_factor must be passed in and scale_factor is used to compute the
output size. The computed output size will be used to infer new scales for
the interpolation. Note that when scale_factor is floating-point, it may differ
from the recomputed scale_factor due to rounding and precision issues.
If recompute_scale_factor is False, then size or scale_factor will
be used directly for interpolation.