mrpro.utils.interpolate

mrpro.utils.interpolate(x: Tensor, size: Sequence[int], dim: Sequence[int], mode: Literal['nearest', 'linear'] = 'linear') Tensor[source]

Interpolate the tensor x along the axes dim to the new size.

Parameters:
  • x (Tensor) – Tensor to interpolate

  • size (Sequence[int]) – New size of the tensor

  • dim (Sequence[int]) – Axes to interpolate over. Must have the same length as size.

  • mode (Literal['nearest', 'linear'], default: 'linear') – Interpolation mode.

Returns:

The interpolated tensor, with the new size.