get_resize_for_vision_encoder(pixel_values, vision_encoder_max_size) {
        let [height, width] = pixel_values.dims.slice(-2);

        const aspect_ratio = width / height;
        if (width >= height) {
            width = Math.ceil(width / vision_encoder_max_size) * vision_encoder_max_size;
            height = Math.floor(width / aspect_ratio);
            height = Math.ceil(height / vision_encoder_max_size) * vision_encoder_max_size;
        } else {
            height = Math.ceil(height / vision_encoder_max_size) * vision_encoder_max_size;
            width = Math.floor(height * aspect_ratio);
            width = Math.ceil(width / vision_encoder_max_size) * vision_encoder_max_size;
        }
        return { height, width };
    }
Calculate size to resize images to, to be multiples of `vision_encoder_max_size` while preserving the aspect ratio.
@param {Tensor} pixel_values Tensor of the image to resize.
@param {number} vision_encoder_max_size Maximum size of the output image. If the image is larger than this size,
it will be split into patches of this size, and the original image will be concatenated with the patches, resized to max_size.