We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
bug in ycbcr_to_rgb function
### Describe the bug

https://github.com/kornia/kornia/blob/2c084f8dc108b3f0f3c8983ac3f25bf88638d01a/kornia/color/ycbcr.py#L70
#### now:
 return torch.stack([r, g, b], -3)
#### need to be:
 return torch.stack([r, g, b], -3).clamp(0,1)
#### because:
![image](https://user-images.githubusercontent.com/33345538/234479794-79174b56-4041-4e9c-96f3-d3117ce44104.png)


--- 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/color/ycbcr.py`
Content:
```
1 import torch
2 from torch import Tensor, nn
3 
4 
5 def _rgb_to_y(r: Tensor, g: Tensor, b: Tensor) -> Tensor:
6     y: Tensor = 0.299 * r + 0.587 * g + 0.114 * b
7     return y
8 
9 
10 def rgb_to_ycbcr(image: Tensor) -> Tensor:
11     r"""Convert an RGB image to YCbCr.
12 
13     .. image:: _static/img/rgb_to_ycbcr.png
14 
15     Args:
16         image: RGB Image to be converted to YCbCr with shape :math:`(*, 3, H, W)`.
17 
18     Returns:
19         YCbCr version of the image with shape :math:`(*, 3, H, W)`.
20 
21     Examples:
22         >>> input = torch.rand(2, 3, 4, 5)
23         >>> output = rgb_to_ycbcr(input)  # 2x3x4x5
24     """
25     if not isinstance(image, Tensor):
26         raise TypeError(f"Input type is not a Tensor. Got {type(image)}")
27 
28     if len(image.shape) < 3 or image.shape[-3] != 3:
29         raise ValueError(f"Input size must have a shape of (*, 3, H, W). Got {image.shape}")
30 
31     r: Tensor = image[..., 0, :, :]
32     g: Tensor = image[..., 1, :, :]
33     b: Tensor = image[..., 2, :, :]
34 
35     delta: float = 0.5
36     y: Tensor = _rgb_to_y(r, g, b)
37     cb: Tensor = (b - y) * 0.564 + delta
38     cr: Tensor = (r - y) * 0.713 + delta
39     return torch.stack([y, cb, cr], -3)
40 
41 
42 def rgb_to_y(image: Tensor) -> Tensor:
43     r"""Convert an RGB image to Y.
44 
45     Args:
46         image: RGB Image to be converted to Y with shape :math:`(*, 3, H, W)`.
47 
48     Returns:
49         Y version of the image with shape :math:`(*, 1, H, W)`.
50 
51     Examples:
52         >>> input = torch.rand(2, 3, 4, 5)
53         >>> output = rgb_to_y(input)  # 2x1x4x5
54     """
55     if not isinstance(image, Tensor):
56         raise TypeError(f"Input type is not a Tensor. Got {type(image)}")
57 
58     if len(image.shape) < 3 or image.shape[-3] != 3:
59         raise ValueError(f"Input size must have a shape of (*, 3, H, W). Got {image.shape}")
60 
61     r: Tensor = image[..., 0:1, :, :]
62     g: Tensor = image[..., 1:2, :, :]
63     b: Tensor = image[..., 2:3, :, :]
64 
65     y: Tensor = _rgb_to_y(r, g, b)
66     return y
67 
68 
69 def ycbcr_to_rgb(image: Tensor) -> Tensor:
70     r"""Convert an YCbCr image to RGB.
71 
72     The image data is assumed to be in the range of (0, 1).
73 
74     Args:
75         image: YCbCr Image to be converted to RGB with shape :math:`(*, 3, H, W)`.
76 
77     Returns:
78         RGB version of the image with shape :math:`(*, 3, H, W)`.
79 
80     Examples:
81         >>> input = torch.rand(2, 3, 4, 5)
82         >>> output = ycbcr_to_rgb(input)  # 2x3x4x5
83     """
84     if not isinstance(image, Tensor):
85         raise TypeError(f"Input type is not a Tensor. Got {type(image)}")
86 
87     if len(image.shape) < 3 or image.shape[-3] != 3:
88         raise ValueError(f"Input size must have a shape of (*, 3, H, W). Got {image.shape}")
89 
90     y: Tensor = image[..., 0, :, :]
91     cb: Tensor = image[..., 1, :, :]
92     cr: Tensor = image[..., 2, :, :]
93 
94     delta: float = 0.5
95     cb_shifted: Tensor = cb - delta
96     cr_shifted: Tensor = cr - delta
97 
98     r: Tensor = y + 1.403 * cr_shifted
99     g: Tensor = y - 0.714 * cr_shifted - 0.344 * cb_shifted
100     b: Tensor = y + 1.773 * cb_shifted
101     return torch.stack([r, g, b], -3)
102 
103 
104 class RgbToYcbcr(nn.Module):
105     r"""Convert an image from RGB to YCbCr.
106 
107     The image data is assumed to be in the range of (0, 1).
108 
109     Returns:
110         YCbCr version of the image.
111 
112     Shape:
113         - image: :math:`(*, 3, H, W)`
114         - output: :math:`(*, 3, H, W)`
115 
116     Examples:
117         >>> input = torch.rand(2, 3, 4, 5)
118         >>> ycbcr = RgbToYcbcr()
119         >>> output = ycbcr(input)  # 2x3x4x5
120     """
121 
122     def forward(self, image: Tensor) -> Tensor:
123         return rgb_to_ycbcr(image)
124 
125 
126 class YcbcrToRgb(nn.Module):
127     r"""Convert an image from YCbCr to Rgb.
128 
129     The image data is assumed to be in the range of (0, 1).
130 
131     Returns:
132         RGB version of the image.
133 
134     Shape:
135         - image: :math:`(*, 3, H, W)`
136         - output: :math:`(*, 3, H, W)`
137 
138     Examples:
139         >>> input = torch.rand(2, 3, 4, 5)
140         >>> rgb = YcbcrToRgb()
141         >>> output = rgb(input)  # 2x3x4x5
142     """
143 
144     def forward(self, image: Tensor) -> Tensor:
145         return ycbcr_to_rgb(image)
146
```
--- 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()

```

diff --git a/kornia/color/ycbcr.py b/kornia/color/ycbcr.py
--- a/kornia/color/ycbcr.py
+++ b/kornia/color/ycbcr.py
@@ -98,7 +98,7 @@
     r: Tensor = y + 1.403 * cr_shifted
     g: Tensor = y - 0.714 * cr_shifted - 0.344 * cb_shifted
     b: Tensor = y + 1.773 * cb_shifted
-    return torch.stack([r, g, b], -3)
+    return torch.stack([r, g, b], -3).clamp(0, 1)
 
 
 class RgbToYcbcr(nn.Module):

{"golden_diff": "diff --git a/kornia/color/ycbcr.py b/kornia/color/ycbcr.py\n--- a/kornia/color/ycbcr.py\n+++ b/kornia/color/ycbcr.py\n@@ -98,7 +98,7 @@\n     r: Tensor = y + 1.403 * cr_shifted\n     g: Tensor = y - 0.714 * cr_shifted - 0.344 * cb_shifted\n     b: Tensor = y + 1.773 * cb_shifted\n-    return torch.stack([r, g, b], -3)\n+    return torch.stack([r, g, b], -3).clamp(0, 1)\n \n \n class RgbToYcbcr(nn.Module):\n", "issue": "bug in ycbcr_to_rgb function\n### Describe the bug\r\n\r\nhttps://github.com/kornia/kornia/blob/2c084f8dc108b3f0f3c8983ac3f25bf88638d01a/kornia/color/ycbcr.py#L70\r\n#### now:\r\n return torch.stack([r, g, b], -3)\r\n#### need to be:\r\n return torch.stack([r, g, b], -3).clamp(0,1)\r\n#### because:\r\n![image](https://user-images.githubusercontent.com/33345538/234479794-79174b56-4041-4e9c-96f3-d3117ce44104.png)\r\n\n", "before_files": [{"content": "import torch\nfrom torch import Tensor, nn\n\n\ndef _rgb_to_y(r: Tensor, g: Tensor, b: Tensor) -> Tensor:\n    y: Tensor = 0.299 * r + 0.587 * g + 0.114 * b\n    return y\n\n\ndef rgb_to_ycbcr(image: Tensor) -> Tensor:\n    r\"\"\"Convert an RGB image to YCbCr.\n\n    .. image:: _static/img/rgb_to_ycbcr.png\n\n    Args:\n        image: RGB Image to be converted to YCbCr with shape :math:`(*, 3, H, W)`.\n\n    Returns:\n        YCbCr version of the image with shape :math:`(*, 3, H, W)`.\n\n    Examples:\n        >>> input = torch.rand(2, 3, 4, 5)\n        >>> output = rgb_to_ycbcr(input)  # 2x3x4x5\n    \"\"\"\n    if not isinstance(image, Tensor):\n        raise TypeError(f\"Input type is not a Tensor. Got {type(image)}\")\n\n    if len(image.shape) < 3 or image.shape[-3] != 3:\n        raise ValueError(f\"Input size must have a shape of (*, 3, H, W). Got {image.shape}\")\n\n    r: Tensor = image[..., 0, :, :]\n    g: Tensor = image[..., 1, :, :]\n    b: Tensor = image[..., 2, :, :]\n\n    delta: float = 0.5\n    y: Tensor = _rgb_to_y(r, g, b)\n    cb: Tensor = (b - y) * 0.564 + delta\n    cr: Tensor = (r - y) * 0.713 + delta\n    return torch.stack([y, cb, cr], -3)\n\n\ndef rgb_to_y(image: Tensor) -> Tensor:\n    r\"\"\"Convert an RGB image to Y.\n\n    Args:\n        image: RGB Image to be converted to Y with shape :math:`(*, 3, H, W)`.\n\n    Returns:\n        Y version of the image with shape :math:`(*, 1, H, W)`.\n\n    Examples:\n        >>> input = torch.rand(2, 3, 4, 5)\n        >>> output = rgb_to_y(input)  # 2x1x4x5\n    \"\"\"\n    if not isinstance(image, Tensor):\n        raise TypeError(f\"Input type is not a Tensor. Got {type(image)}\")\n\n    if len(image.shape) < 3 or image.shape[-3] != 3:\n        raise ValueError(f\"Input size must have a shape of (*, 3, H, W). Got {image.shape}\")\n\n    r: Tensor = image[..., 0:1, :, :]\n    g: Tensor = image[..., 1:2, :, :]\n    b: Tensor = image[..., 2:3, :, :]\n\n    y: Tensor = _rgb_to_y(r, g, b)\n    return y\n\n\ndef ycbcr_to_rgb(image: Tensor) -> Tensor:\n    r\"\"\"Convert an YCbCr image to RGB.\n\n    The image data is assumed to be in the range of (0, 1).\n\n    Args:\n        image: YCbCr Image to be converted to RGB with shape :math:`(*, 3, H, W)`.\n\n    Returns:\n        RGB version of the image with shape :math:`(*, 3, H, W)`.\n\n    Examples:\n        >>> input = torch.rand(2, 3, 4, 5)\n        >>> output = ycbcr_to_rgb(input)  # 2x3x4x5\n    \"\"\"\n    if not isinstance(image, Tensor):\n        raise TypeError(f\"Input type is not a Tensor. Got {type(image)}\")\n\n    if len(image.shape) < 3 or image.shape[-3] != 3:\n        raise ValueError(f\"Input size must have a shape of (*, 3, H, W). Got {image.shape}\")\n\n    y: Tensor = image[..., 0, :, :]\n    cb: Tensor = image[..., 1, :, :]\n    cr: Tensor = image[..., 2, :, :]\n\n    delta: float = 0.5\n    cb_shifted: Tensor = cb - delta\n    cr_shifted: Tensor = cr - delta\n\n    r: Tensor = y + 1.403 * cr_shifted\n    g: Tensor = y - 0.714 * cr_shifted - 0.344 * cb_shifted\n    b: Tensor = y + 1.773 * cb_shifted\n    return torch.stack([r, g, b], -3)\n\n\nclass RgbToYcbcr(nn.Module):\n    r\"\"\"Convert an image from RGB to YCbCr.\n\n    The image data is assumed to be in the range of (0, 1).\n\n    Returns:\n        YCbCr version of the image.\n\n    Shape:\n        - image: :math:`(*, 3, H, W)`\n        - output: :math:`(*, 3, H, W)`\n\n    Examples:\n        >>> input = torch.rand(2, 3, 4, 5)\n        >>> ycbcr = RgbToYcbcr()\n        >>> output = ycbcr(input)  # 2x3x4x5\n    \"\"\"\n\n    def forward(self, image: Tensor) -> Tensor:\n        return rgb_to_ycbcr(image)\n\n\nclass YcbcrToRgb(nn.Module):\n    r\"\"\"Convert an image from YCbCr to Rgb.\n\n    The image data is assumed to be in the range of (0, 1).\n\n    Returns:\n        RGB version of the image.\n\n    Shape:\n        - image: :math:`(*, 3, H, W)`\n        - output: :math:`(*, 3, H, W)`\n\n    Examples:\n        >>> input = torch.rand(2, 3, 4, 5)\n        >>> rgb = YcbcrToRgb()\n        >>> output = rgb(input)  # 2x3x4x5\n    \"\"\"\n\n    def forward(self, image: Tensor) -> Tensor:\n        return ycbcr_to_rgb(image)\n", "path": "kornia/color/ycbcr.py"}], "after_files": [{"content": "import torch\nfrom torch import Tensor, nn\n\n\ndef _rgb_to_y(r: Tensor, g: Tensor, b: Tensor) -> Tensor:\n    y: Tensor = 0.299 * r + 0.587 * g + 0.114 * b\n    return y\n\n\ndef rgb_to_ycbcr(image: Tensor) -> Tensor:\n    r\"\"\"Convert an RGB image to YCbCr.\n\n    .. image:: _static/img/rgb_to_ycbcr.png\n\n    Args:\n        image: RGB Image to be converted to YCbCr with shape :math:`(*, 3, H, W)`.\n\n    Returns:\n        YCbCr version of the image with shape :math:`(*, 3, H, W)`.\n\n    Examples:\n        >>> input = torch.rand(2, 3, 4, 5)\n        >>> output = rgb_to_ycbcr(input)  # 2x3x4x5\n    \"\"\"\n    if not isinstance(image, Tensor):\n        raise TypeError(f\"Input type is not a Tensor. Got {type(image)}\")\n\n    if len(image.shape) < 3 or image.shape[-3] != 3:\n        raise ValueError(f\"Input size must have a shape of (*, 3, H, W). Got {image.shape}\")\n\n    r: Tensor = image[..., 0, :, :]\n    g: Tensor = image[..., 1, :, :]\n    b: Tensor = image[..., 2, :, :]\n\n    delta: float = 0.5\n    y: Tensor = _rgb_to_y(r, g, b)\n    cb: Tensor = (b - y) * 0.564 + delta\n    cr: Tensor = (r - y) * 0.713 + delta\n    return torch.stack([y, cb, cr], -3)\n\n\ndef rgb_to_y(image: Tensor) -> Tensor:\n    r\"\"\"Convert an RGB image to Y.\n\n    Args:\n        image: RGB Image to be converted to Y with shape :math:`(*, 3, H, W)`.\n\n    Returns:\n        Y version of the image with shape :math:`(*, 1, H, W)`.\n\n    Examples:\n        >>> input = torch.rand(2, 3, 4, 5)\n        >>> output = rgb_to_y(input)  # 2x1x4x5\n    \"\"\"\n    if not isinstance(image, Tensor):\n        raise TypeError(f\"Input type is not a Tensor. Got {type(image)}\")\n\n    if len(image.shape) < 3 or image.shape[-3] != 3:\n        raise ValueError(f\"Input size must have a shape of (*, 3, H, W). Got {image.shape}\")\n\n    r: Tensor = image[..., 0:1, :, :]\n    g: Tensor = image[..., 1:2, :, :]\n    b: Tensor = image[..., 2:3, :, :]\n\n    y: Tensor = _rgb_to_y(r, g, b)\n    return y\n\n\ndef ycbcr_to_rgb(image: Tensor) -> Tensor:\n    r\"\"\"Convert an YCbCr image to RGB.\n\n    The image data is assumed to be in the range of (0, 1).\n\n    Args:\n        image: YCbCr Image to be converted to RGB with shape :math:`(*, 3, H, W)`.\n\n    Returns:\n        RGB version of the image with shape :math:`(*, 3, H, W)`.\n\n    Examples:\n        >>> input = torch.rand(2, 3, 4, 5)\n        >>> output = ycbcr_to_rgb(input)  # 2x3x4x5\n    \"\"\"\n    if not isinstance(image, Tensor):\n        raise TypeError(f\"Input type is not a Tensor. Got {type(image)}\")\n\n    if len(image.shape) < 3 or image.shape[-3] != 3:\n        raise ValueError(f\"Input size must have a shape of (*, 3, H, W). Got {image.shape}\")\n\n    y: Tensor = image[..., 0, :, :]\n    cb: Tensor = image[..., 1, :, :]\n    cr: Tensor = image[..., 2, :, :]\n\n    delta: float = 0.5\n    cb_shifted: Tensor = cb - delta\n    cr_shifted: Tensor = cr - delta\n\n    r: Tensor = y + 1.403 * cr_shifted\n    g: Tensor = y - 0.714 * cr_shifted - 0.344 * cb_shifted\n    b: Tensor = y + 1.773 * cb_shifted\n    return torch.stack([r, g, b], -3).clamp(0, 1)\n\n\nclass RgbToYcbcr(nn.Module):\n    r\"\"\"Convert an image from RGB to YCbCr.\n\n    The image data is assumed to be in the range of (0, 1).\n\n    Returns:\n        YCbCr version of the image.\n\n    Shape:\n        - image: :math:`(*, 3, H, W)`\n        - output: :math:`(*, 3, H, W)`\n\n    Examples:\n        >>> input = torch.rand(2, 3, 4, 5)\n        >>> ycbcr = RgbToYcbcr()\n        >>> output = ycbcr(input)  # 2x3x4x5\n    \"\"\"\n\n    def forward(self, image: Tensor) -> Tensor:\n        return rgb_to_ycbcr(image)\n\n\nclass YcbcrToRgb(nn.Module):\n    r\"\"\"Convert an image from YCbCr to Rgb.\n\n    The image data is assumed to be in the range of (0, 1).\n\n    Returns:\n        RGB version of the image.\n\n    Shape:\n        - image: :math:`(*, 3, H, W)`\n        - output: :math:`(*, 3, H, W)`\n\n    Examples:\n        >>> input = torch.rand(2, 3, 4, 5)\n        >>> rgb = YcbcrToRgb()\n        >>> output = rgb(input)  # 2x3x4x5\n    \"\"\"\n\n    def forward(self, image: Tensor) -> Tensor:\n        return ycbcr_to_rgb(image)\n", "path": "kornia/color/ycbcr.py"}]}