mr2.utils.interpolate
- mr2.utils.interpolate(x: Tensor, size: Sequence[int], dim: Sequence[int], mode: Literal['nearest', 'linear', 'area', 'cubic'] = 'linear', *, align_corners: bool | None = None) Tensor[source]
Interpolate the tensor x along the axes dim to the new size.
- Parameters:
x (
Tensor) – Tensor to interpolatedim (
Sequence[int]) – Axes to interpolate over. Must have the same length as size.mode (
Literal['nearest','linear','area','cubic'], default:'linear') – Interpolation mode.align_corners (
bool|None, default:None) – Forwarded to interpolation backends for linear and cubic modes.
- Returns:
The interpolated tensor, with the new size.