Skip to main content
Log in

Mojo function

resize_linear

resize_linear[coordinate_transformation_mode: CoordinateTransformationMode, antialias: Bool, rank: Int, type: DType](input: NDBuffer[type, rank, origin], output: NDBuffer[type, rank, origin])

Resizes input to output shape using linear interpolation.

Does not use anti-aliasing filter for downsampling (coming soon).

Parameters:

  • coordinate_transformation_mode (CoordinateTransformationMode): How to map a coordinate in output to a coordinate in input.
  • antialias (Bool): Whether or not to use an antialiasing linear/cubic filter, which when downsampling, uses more points to avoid aliasing artifacts. Effectively stretches the filter by a factor of 1 / scale.
  • rank (Int): Rank of the input and output.
  • type (DType): Type of input and output.

Args:

  • input (NDBuffer[type, rank, origin]): The input to be resized.
  • output (NDBuffer[type, rank, origin]): The output containing the resized input.