prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  kornia.augmentation.resize does not have antialias flag, unlike kornia.geometry.transform.resize
  ### Describe the bug
  
  Check 
  https://kornia.readthedocs.io/en/latest/_modules/kornia/augmentation/_2d/geometric/resize.html#Resize
  
  versus 
  https://kornia.readthedocs.io/en/latest/geometry.transform.html#kornia.geometry.transform.Resize
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `kornia/augmentation/_2d/geometric/resize.py`
  Content:
  ```
  1 from typing import Dict, Optional, Tuple, Union, cast
  2 
  3 import torch
  4 from torch import Tensor
  5 
  6 from kornia.augmentation import random_generator as rg
  7 from kornia.augmentation._2d.geometric.base import GeometricAugmentationBase2D
  8 from kornia.constants import Resample
  9 from kornia.geometry.transform import crop_by_transform_mat, get_perspective_transform, resize
  10 from kornia.utils import eye_like
  11 
  12 
  13 class Resize(GeometricAugmentationBase2D):
  14     """Resize to size.
  15 
  16     Args:
  17         size: Size (h, w) in pixels of the resized region or just one side.
  18         side: Which side to resize, if size is only of type int.
  19         resample: Resampling mode.
  20         align_corners: interpolation flag.
  21         keepdim: whether to keep the output shape the same as input (True) or broadcast it
  22             to the batch form (False).
  23     """
  24 
  25     def __init__(
  26         self,
  27         size: Union[int, Tuple[int, int]],
  28         side: str = "short",
  29         resample: Union[str, int, Resample] = Resample.BILINEAR.name,
  30         align_corners: bool = True,
  31         p: float = 1.0,
  32         return_transform: Optional[bool] = None,
  33         keepdim: bool = False,
  34     ) -> None:
  35         super().__init__(p=1., return_transform=return_transform, same_on_batch=True, p_batch=p, keepdim=keepdim)
  36         self._param_generator = cast(rg.ResizeGenerator, rg.ResizeGenerator(resize_to=size, side=side))
  37         self.flags = dict(size=size, side=side, resample=Resample.get(resample), align_corners=align_corners)
  38 
  39     def compute_transformation(self, input: Tensor, params: Dict[str, Tensor]) -> Tensor:
  40         if params["output_size"] == input.shape[-2:]:
  41             return eye_like(3, input)
  42 
  43         transform: Tensor = get_perspective_transform(params["src"], params["dst"])
  44         transform = transform.expand(input.shape[0], -1, -1)
  45         return transform
  46 
  47     def apply_transform(
  48         self, input: Tensor, params: Dict[str, Tensor], transform: Optional[Tensor] = None
  49     ) -> Tensor:
  50         B, C, _, _ = input.shape
  51         out_size = tuple(params["output_size"][0].tolist())
  52         out = torch.empty(B, C, *out_size, device=input.device, dtype=input.dtype)
  53         for i in range(B):
  54             x1 = int(params["src"][i, 0, 0])
  55             x2 = int(params["src"][i, 1, 0]) + 1
  56             y1 = int(params["src"][i, 0, 1])
  57             y2 = int(params["src"][i, 3, 1]) + 1
  58             out[i] = resize(
  59                 input[i : i + 1, :, y1:y2, x1:x2],
  60                 out_size,
  61                 interpolation=(self.flags["resample"].name).lower(),
  62                 align_corners=self.flags["align_corners"],
  63             )
  64         return out
  65 
  66     def inverse_transform(
  67         self,
  68         input: Tensor,
  69         transform: Optional[Tensor] = None,
  70         size: Optional[Tuple[int, int]] = None,
  71         **kwargs,
  72     ) -> Tensor:
  73         size = cast(Tuple[int, int], size)
  74         mode = self.flags["resample"].name.lower() if "mode" not in kwargs else kwargs["mode"]
  75         align_corners = self.flags["align_corners"] if "align_corners" not in kwargs else kwargs["align_corners"]
  76         padding_mode = "zeros" if "padding_mode" not in kwargs else kwargs["padding_mode"]
  77         transform = cast(Tensor, transform)
  78         return crop_by_transform_mat(input, transform[:, :2, :], size, mode, padding_mode, align_corners)
  79 
  80 
  81 class LongestMaxSize(Resize):
  82     """Rescale an image so that maximum side is equal to max_size, keeping the aspect ratio of the initial image.
  83 
  84     Args:
  85         max_size: maximum size of the image after the transformation.
  86     """
  87 
  88     def __init__(
  89         self,
  90         max_size: int,
  91         resample: Union[str, int, Resample] = Resample.BILINEAR.name,
  92         align_corners: bool = True,
  93         p: float = 1.0,
  94         return_transform: Optional[bool] = None,
  95     ) -> None:
  96         # TODO: Support max_size list input to randomly select from
  97         super().__init__(
  98             size=max_size,
  99             side="long",
  100             resample=resample,
  101             return_transform=return_transform,
  102             align_corners=align_corners,
  103             p=p,
  104         )
  105 
  106 
  107 class SmallestMaxSize(Resize):
  108     """Rescale an image so that minimum side is equal to max_size, keeping the aspect ratio of the initial image.
  109 
  110     Args:
  111         max_size: maximum size of the image after the transformation.
  112     """
  113 
  114     def __init__(
  115         self,
  116         max_size: int,
  117         resample: Union[str, int, Resample] = Resample.BILINEAR.name,
  118         align_corners: bool = True,
  119         p: float = 1.0,
  120         return_transform: Optional[bool] = None,
  121     ) -> None:
  122         # TODO: Support max_size list input to randomly select from
  123         super().__init__(
  124             size=max_size,
  125             side="short",
  126             resample=resample,
  127             return_transform=return_transform,
  128             align_corners=align_corners,
  129             p=p,
  130         )
  131
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/kornia/augmentation/_2d/geometric/resize.py b/kornia/augmentation/_2d/geometric/resize.py
  --- a/kornia/augmentation/_2d/geometric/resize.py
  +++ b/kornia/augmentation/_2d/geometric/resize.py
  @@ -18,6 +18,7 @@
           side: Which side to resize, if size is only of type int.
           resample: Resampling mode.
           align_corners: interpolation flag.
  +        antialias: if True, then image will be filtered with Gaussian before downscaling. No effect for upscaling.
           keepdim: whether to keep the output shape the same as input (True) or broadcast it
               to the batch form (False).
       """
  @@ -28,13 +29,20 @@
           side: str = "short",
           resample: Union[str, int, Resample] = Resample.BILINEAR.name,
           align_corners: bool = True,
  +        antialias: bool = False,
           p: float = 1.0,
           return_transform: Optional[bool] = None,
           keepdim: bool = False,
       ) -> None:
           super().__init__(p=1., return_transform=return_transform, same_on_batch=True, p_batch=p, keepdim=keepdim)
           self._param_generator = cast(rg.ResizeGenerator, rg.ResizeGenerator(resize_to=size, side=side))
  -        self.flags = dict(size=size, side=side, resample=Resample.get(resample), align_corners=align_corners)
  +        self.flags = dict(
  +            size=size,
  +            side=side,
  +            resample=Resample.get(resample),
  +            align_corners=align_corners,
  +            antialias=antialias
  +        )
   
       def compute_transformation(self, input: Tensor, params: Dict[str, Tensor]) -> Tensor:
           if params["output_size"] == input.shape[-2:]:
  @@ -60,6 +68,7 @@
                   out_size,
                   interpolation=(self.flags["resample"].name).lower(),
                   align_corners=self.flags["align_corners"],
  +                antialias=self.flags["antialias"]
               )
           return out
  
verification_info: {"golden_diff": "diff --git a/kornia/augmentation/_2d/geometric/resize.py b/kornia/augmentation/_2d/geometric/resize.py\n--- a/kornia/augmentation/_2d/geometric/resize.py\n+++ b/kornia/augmentation/_2d/geometric/resize.py\n@@ -18,6 +18,7 @@\n         side: Which side to resize, if size is only of type int.\n         resample: Resampling mode.\n         align_corners: interpolation flag.\n+        antialias: if True, then image will be filtered with Gaussian before downscaling. No effect for upscaling.\n         keepdim: whether to keep the output shape the same as input (True) or broadcast it\n             to the batch form (False).\n     \"\"\"\n@@ -28,13 +29,20 @@\n         side: str = \"short\",\n         resample: Union[str, int, Resample] = Resample.BILINEAR.name,\n         align_corners: bool = True,\n+        antialias: bool = False,\n         p: float = 1.0,\n         return_transform: Optional[bool] = None,\n         keepdim: bool = False,\n     ) -> None:\n         super().__init__(p=1., return_transform=return_transform, same_on_batch=True, p_batch=p, keepdim=keepdim)\n         self._param_generator = cast(rg.ResizeGenerator, rg.ResizeGenerator(resize_to=size, side=side))\n-        self.flags = dict(size=size, side=side, resample=Resample.get(resample), align_corners=align_corners)\n+        self.flags = dict(\n+            size=size,\n+            side=side,\n+            resample=Resample.get(resample),\n+            align_corners=align_corners,\n+            antialias=antialias\n+        )\n \n     def compute_transformation(self, input: Tensor, params: Dict[str, Tensor]) -> Tensor:\n         if params[\"output_size\"] == input.shape[-2:]:\n@@ -60,6 +68,7 @@\n                 out_size,\n                 interpolation=(self.flags[\"resample\"].name).lower(),\n                 align_corners=self.flags[\"align_corners\"],\n+                antialias=self.flags[\"antialias\"]\n             )\n         return out\n", "issue": "kornia.augmentation.resize does not have antialias flag, unlike kornia.geometry.transform.resize\n### Describe the bug\r\n\r\nCheck \r\nhttps://kornia.readthedocs.io/en/latest/_modules/kornia/augmentation/_2d/geometric/resize.html#Resize\r\n\r\nversus \r\nhttps://kornia.readthedocs.io/en/latest/geometry.transform.html#kornia.geometry.transform.Resize\n", "before_files": [{"content": "from typing import Dict, Optional, Tuple, Union, cast\n\nimport torch\nfrom torch import Tensor\n\nfrom kornia.augmentation import random_generator as rg\nfrom kornia.augmentation._2d.geometric.base import GeometricAugmentationBase2D\nfrom kornia.constants import Resample\nfrom kornia.geometry.transform import crop_by_transform_mat, get_perspective_transform, resize\nfrom kornia.utils import eye_like\n\n\nclass Resize(GeometricAugmentationBase2D):\n    \"\"\"Resize to size.\n\n    Args:\n        size: Size (h, w) in pixels of the resized region or just one side.\n        side: Which side to resize, if size is only of type int.\n        resample: Resampling mode.\n        align_corners: interpolation flag.\n        keepdim: whether to keep the output shape the same as input (True) or broadcast it\n            to the batch form (False).\n    \"\"\"\n\n    def __init__(\n        self,\n        size: Union[int, Tuple[int, int]],\n        side: str = \"short\",\n        resample: Union[str, int, Resample] = Resample.BILINEAR.name,\n        align_corners: bool = True,\n        p: float = 1.0,\n        return_transform: Optional[bool] = None,\n        keepdim: bool = False,\n    ) -> None:\n        super().__init__(p=1., return_transform=return_transform, same_on_batch=True, p_batch=p, keepdim=keepdim)\n        self._param_generator = cast(rg.ResizeGenerator, rg.ResizeGenerator(resize_to=size, side=side))\n        self.flags = dict(size=size, side=side, resample=Resample.get(resample), align_corners=align_corners)\n\n    def compute_transformation(self, input: Tensor, params: Dict[str, Tensor]) -> Tensor:\n        if params[\"output_size\"] == input.shape[-2:]:\n            return eye_like(3, input)\n\n        transform: Tensor = get_perspective_transform(params[\"src\"], params[\"dst\"])\n        transform = transform.expand(input.shape[0], -1, -1)\n        return transform\n\n    def apply_transform(\n        self, input: Tensor, params: Dict[str, Tensor], transform: Optional[Tensor] = None\n    ) -> Tensor:\n        B, C, _, _ = input.shape\n        out_size = tuple(params[\"output_size\"][0].tolist())\n        out = torch.empty(B, C, *out_size, device=input.device, dtype=input.dtype)\n        for i in range(B):\n            x1 = int(params[\"src\"][i, 0, 0])\n            x2 = int(params[\"src\"][i, 1, 0]) + 1\n            y1 = int(params[\"src\"][i, 0, 1])\n            y2 = int(params[\"src\"][i, 3, 1]) + 1\n            out[i] = resize(\n                input[i : i + 1, :, y1:y2, x1:x2],\n                out_size,\n                interpolation=(self.flags[\"resample\"].name).lower(),\n                align_corners=self.flags[\"align_corners\"],\n            )\n        return out\n\n    def inverse_transform(\n        self,\n        input: Tensor,\n        transform: Optional[Tensor] = None,\n        size: Optional[Tuple[int, int]] = None,\n        **kwargs,\n    ) -> Tensor:\n        size = cast(Tuple[int, int], size)\n        mode = self.flags[\"resample\"].name.lower() if \"mode\" not in kwargs else kwargs[\"mode\"]\n        align_corners = self.flags[\"align_corners\"] if \"align_corners\" not in kwargs else kwargs[\"align_corners\"]\n        padding_mode = \"zeros\" if \"padding_mode\" not in kwargs else kwargs[\"padding_mode\"]\n        transform = cast(Tensor, transform)\n        return crop_by_transform_mat(input, transform[:, :2, :], size, mode, padding_mode, align_corners)\n\n\nclass LongestMaxSize(Resize):\n    \"\"\"Rescale an image so that maximum side is equal to max_size, keeping the aspect ratio of the initial image.\n\n    Args:\n        max_size: maximum size of the image after the transformation.\n    \"\"\"\n\n    def __init__(\n        self,\n        max_size: int,\n        resample: Union[str, int, Resample] = Resample.BILINEAR.name,\n        align_corners: bool = True,\n        p: float = 1.0,\n        return_transform: Optional[bool] = None,\n    ) -> None:\n        # TODO: Support max_size list input to randomly select from\n        super().__init__(\n            size=max_size,\n            side=\"long\",\n            resample=resample,\n            return_transform=return_transform,\n            align_corners=align_corners,\n            p=p,\n        )\n\n\nclass SmallestMaxSize(Resize):\n    \"\"\"Rescale an image so that minimum side is equal to max_size, keeping the aspect ratio of the initial image.\n\n    Args:\n        max_size: maximum size of the image after the transformation.\n    \"\"\"\n\n    def __init__(\n        self,\n        max_size: int,\n        resample: Union[str, int, Resample] = Resample.BILINEAR.name,\n        align_corners: bool = True,\n        p: float = 1.0,\n        return_transform: Optional[bool] = None,\n    ) -> None:\n        # TODO: Support max_size list input to randomly select from\n        super().__init__(\n            size=max_size,\n            side=\"short\",\n            resample=resample,\n            return_transform=return_transform,\n            align_corners=align_corners,\n            p=p,\n        )\n", "path": "kornia/augmentation/_2d/geometric/resize.py"}], "after_files": [{"content": "from typing import Dict, Optional, Tuple, Union, cast\n\nimport torch\nfrom torch import Tensor\n\nfrom kornia.augmentation import random_generator as rg\nfrom kornia.augmentation._2d.geometric.base import GeometricAugmentationBase2D\nfrom kornia.constants import Resample\nfrom kornia.geometry.transform import crop_by_transform_mat, get_perspective_transform, resize\nfrom kornia.utils import eye_like\n\n\nclass Resize(GeometricAugmentationBase2D):\n    \"\"\"Resize to size.\n\n    Args:\n        size: Size (h, w) in pixels of the resized region or just one side.\n        side: Which side to resize, if size is only of type int.\n        resample: Resampling mode.\n        align_corners: interpolation flag.\n        antialias: if True, then image will be filtered with Gaussian before downscaling. No effect for upscaling.\n        keepdim: whether to keep the output shape the same as input (True) or broadcast it\n            to the batch form (False).\n    \"\"\"\n\n    def __init__(\n        self,\n        size: Union[int, Tuple[int, int]],\n        side: str = \"short\",\n        resample: Union[str, int, Resample] = Resample.BILINEAR.name,\n        align_corners: bool = True,\n        antialias: bool = False,\n        p: float = 1.0,\n        return_transform: Optional[bool] = None,\n        keepdim: bool = False,\n    ) -> None:\n        super().__init__(p=1., return_transform=return_transform, same_on_batch=True, p_batch=p, keepdim=keepdim)\n        self._param_generator = cast(rg.ResizeGenerator, rg.ResizeGenerator(resize_to=size, side=side))\n        self.flags = dict(\n            size=size,\n            side=side,\n            resample=Resample.get(resample),\n            align_corners=align_corners,\n            antialias=antialias\n        )\n\n    def compute_transformation(self, input: Tensor, params: Dict[str, Tensor]) -> Tensor:\n        if params[\"output_size\"] == input.shape[-2:]:\n            return eye_like(3, input)\n\n        transform: Tensor = get_perspective_transform(params[\"src\"], params[\"dst\"])\n        transform = transform.expand(input.shape[0], -1, -1)\n        return transform\n\n    def apply_transform(\n        self, input: Tensor, params: Dict[str, Tensor], transform: Optional[Tensor] = None\n    ) -> Tensor:\n        B, C, _, _ = input.shape\n        out_size = tuple(params[\"output_size\"][0].tolist())\n        out = torch.empty(B, C, *out_size, device=input.device, dtype=input.dtype)\n        for i in range(B):\n            x1 = int(params[\"src\"][i, 0, 0])\n            x2 = int(params[\"src\"][i, 1, 0]) + 1\n            y1 = int(params[\"src\"][i, 0, 1])\n            y2 = int(params[\"src\"][i, 3, 1]) + 1\n            out[i] = resize(\n                input[i : i + 1, :, y1:y2, x1:x2],\n                out_size,\n                interpolation=(self.flags[\"resample\"].name).lower(),\n                align_corners=self.flags[\"align_corners\"],\n                antialias=self.flags[\"antialias\"]\n            )\n        return out\n\n    def inverse_transform(\n        self,\n        input: Tensor,\n        transform: Optional[Tensor] = None,\n        size: Optional[Tuple[int, int]] = None,\n        **kwargs,\n    ) -> Tensor:\n        size = cast(Tuple[int, int], size)\n        mode = self.flags[\"resample\"].name.lower() if \"mode\" not in kwargs else kwargs[\"mode\"]\n        align_corners = self.flags[\"align_corners\"] if \"align_corners\" not in kwargs else kwargs[\"align_corners\"]\n        padding_mode = \"zeros\" if \"padding_mode\" not in kwargs else kwargs[\"padding_mode\"]\n        transform = cast(Tensor, transform)\n        return crop_by_transform_mat(input, transform[:, :2, :], size, mode, padding_mode, align_corners)\n\n\nclass LongestMaxSize(Resize):\n    \"\"\"Rescale an image so that maximum side is equal to max_size, keeping the aspect ratio of the initial image.\n\n    Args:\n        max_size: maximum size of the image after the transformation.\n    \"\"\"\n\n    def __init__(\n        self,\n        max_size: int,\n        resample: Union[str, int, Resample] = Resample.BILINEAR.name,\n        align_corners: bool = True,\n        p: float = 1.0,\n        return_transform: Optional[bool] = None,\n    ) -> None:\n        # TODO: Support max_size list input to randomly select from\n        super().__init__(\n            size=max_size,\n            side=\"long\",\n            resample=resample,\n            return_transform=return_transform,\n            align_corners=align_corners,\n            p=p,\n        )\n\n\nclass SmallestMaxSize(Resize):\n    \"\"\"Rescale an image so that minimum side is equal to max_size, keeping the aspect ratio of the initial image.\n\n    Args:\n        max_size: maximum size of the image after the transformation.\n    \"\"\"\n\n    def __init__(\n        self,\n        max_size: int,\n        resample: Union[str, int, Resample] = Resample.BILINEAR.name,\n        align_corners: bool = True,\n        p: float = 1.0,\n        return_transform: Optional[bool] = None,\n    ) -> None:\n        # TODO: Support max_size list input to randomly select from\n        super().__init__(\n            size=max_size,\n            side=\"short\",\n            resample=resample,\n            return_transform=return_transform,\n            align_corners=align_corners,\n            p=p,\n        )\n", "path": "kornia/augmentation/_2d/geometric/resize.py"}]}