function interpolate(input, [out_height, out_width], mode = 'bilinear', align_corners = false) {

    // Input image dimensions
    const in_channels = input.dims.at(-3) ?? 1;
    const in_height = input.dims.at(-2);
    const in_width = input.dims.at(-1);

    let output = interpolate_data(
        /** @type {import('./maths.js').TypedArray}*/(input.data),
        [in_channels, in_height, in_width],
        [out_height, out_width],
        mode,
        align_corners
    );
    return new Tensor(input.type, output, [in_channels, out_height, out_width]);
}
Interpolates an Tensor to the given size.
@param {Tensor} input The input tensor to interpolate. Data must be channel-first (i.e., [c, h, w])
@param {number[]} size The output size of the image
@param {string} mode The interpolation mode
@param {boolean} align_corners Whether to align corners.
@returns {Tensor} The interpolated tensor.