Skip to main content

Mojo function

resize_linear

resize_linear[coordinate_transformation_mode: CoordinateTransformationMode, antialias: Bool, dtype: DType](input: TileTensor[dtype, LayoutType, origin, linear_idx_type=linear_idx_type, element_shape_types=element_shape_types], output: TileTensor[dtype, LayoutType, origin, linear_idx_type=linear_idx_type, element_shape_types=element_shape_types])

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.
  • dtype (DType): Type of input and output.

Args:

  • input (TileTensor): The input to be resized.
  • output (TileTensor): The output containing the resized input.

Was this page helpful?