def forward(self, imgs: Union[Tensor, List[Tensor]], original_sizes: Tensor) -> Union[Tensor, List[Tensor]]:
        """Run forward.

        Returns:
        resized_imgs: resized images in a batch.
        original_sizes: the original image sizes of (height, width).

        """
        # TODO: support other input formats e.g. file path, numpy
        resized_imgs: list[Tensor] = []

        if torch.onnx.is_in_onnx_export():
            warnings.warn(
                "ResizePostProcessor is not supported in ONNX export. "
                "The output will not be resized back to the original size.",
                stacklevel=1,
            )
            return imgs

        iters = len(imgs) if isinstance(imgs, list) else imgs.shape[0]
        for i in range(iters):
            img = imgs[i]
            size = original_sizes[i]
            resized_imgs.append(
                resize(img[None], size=size.cpu().long().numpy().tolist(), interpolation=self.interpolation_mode)
            )
        return resized_imgs
Run forward.

        Returns:
        resized_imgs: resized images in a batch.
        original_sizes: the original image sizes of (height, width).

        
kornia/models/utils.py