prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Bugs when using RandomRGBShift
  ### Describe the bug
  
  When running RandomRGBShift augmentation on gpus I came across this error 
  
  ```
    File "/usr/local/lib/python3.8/dist-packages/kornia/augmentation/_2d/intensity/random_rgb_shift.py", line 100, in apply_transform
      return shift_rgb(inp, params['r_shift'], params['g_shift'], params['b_shift'])
    File "/usr/local/lib/python3.8/dist-packages/kornia/enhance/shift_rgb.py", line 17, in shift_rgb
      shifted = (image + torch.Tensor(shifts).view(1, 3, 1, 1).to(image)).clamp_(min=0, max=1)
  ValueError: only one element tensors can be converted to Python scalars
  ```
  after checking the code I think the problem is that 
  ```
  shifts = [params['r_shift'], params['g_shift'], params['b_shift']]
  shifted = (image + torch.Tensor(shifts).view(1, 3, 1, 1).to(image)).clamp_(min=0, max=1)
  ```
  and also I am not sure about `.view(1,3,1,1)` shouldn't it be `.view(-1,3,1,1)`
  
  ### Reproduction steps
  
  ```bash
  1. setting up RandomRGBShift augmentation
  2. Using RandomRGBShift augmentation with gpus and batchsize > 1
  ```
  
  
  ### Expected behavior
  
  ```
    File "/usr/local/lib/python3.8/dist-packages/kornia/augmentation/_2d/intensity/random_rgb_shift.py", line 100, in apply_transform
      return shift_rgb(inp, params['r_shift'], params['g_shift'], params['b_shift'])
    File "/usr/local/lib/python3.8/dist-packages/kornia/enhance/shift_rgb.py", line 17, in shift_rgb
      shifted = (image + torch.Tensor(shifts).view(1, 3, 1, 1).to(image)).clamp_(min=0, max=1)
  ValueError: only one element tensors can be converted to Python scalars
  ```
  
  ### Environment
  
  ```shell
  - PyTorch Version : 1.10
  - Linux
  - How you installed PyTorch (`pip`):
  - Python version: 3.8
  - cuda:11.3.0-cudnn8
  ```
  
  
  ### Additional context
  
  _No response_
  
  --- 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/enhance/shift_rgb.py`
  Content:
  ```
  1 import torch
  2 
  3 from kornia.testing import KORNIA_CHECK_IS_COLOR, KORNIA_CHECK_IS_TENSOR
  4 
  5 
  6 def shift_rgb(image: torch.Tensor, r_shift: torch.Tensor, g_shift: torch.Tensor, b_shift: torch.Tensor) -> torch.Tensor:
  7     """Shift rgb channels.
  8 
  9     Shift each image's channel by either r_shift for red, g_shift for green and b_shift for blue channels.
  10     """
  11 
  12     KORNIA_CHECK_IS_TENSOR(image)
  13     KORNIA_CHECK_IS_COLOR(image, f"with shape {image.shape}")
  14 
  15     shifts = [r_shift, g_shift, b_shift]
  16 
  17     shifted = (image + torch.Tensor(shifts).view(1, 3, 1, 1).to(image)).clamp_(min=0, max=1)
  18 
  19     return shifted
  20
  ```
  --- 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/enhance/shift_rgb.py b/kornia/enhance/shift_rgb.py
  --- a/kornia/enhance/shift_rgb.py
  +++ b/kornia/enhance/shift_rgb.py
  @@ -14,6 +14,6 @@
   
       shifts = [r_shift, g_shift, b_shift]
   
  -    shifted = (image + torch.Tensor(shifts).view(1, 3, 1, 1).to(image)).clamp_(min=0, max=1)
  +    shifted = (image + torch.stack(shifts).view(-1, 3, 1, 1).to(image)).clamp_(min=0, max=1)
   
       return shifted
  
verification_info: {"golden_diff": "diff --git a/kornia/enhance/shift_rgb.py b/kornia/enhance/shift_rgb.py\n--- a/kornia/enhance/shift_rgb.py\n+++ b/kornia/enhance/shift_rgb.py\n@@ -14,6 +14,6 @@\n \n     shifts = [r_shift, g_shift, b_shift]\n \n-    shifted = (image + torch.Tensor(shifts).view(1, 3, 1, 1).to(image)).clamp_(min=0, max=1)\n+    shifted = (image + torch.stack(shifts).view(-1, 3, 1, 1).to(image)).clamp_(min=0, max=1)\n \n     return shifted\n", "issue": "Bugs when using RandomRGBShift\n### Describe the bug\r\n\r\nWhen running RandomRGBShift augmentation on gpus I came across this error \r\n\r\n```\r\n  File \"/usr/local/lib/python3.8/dist-packages/kornia/augmentation/_2d/intensity/random_rgb_shift.py\", line 100, in apply_transform\r\n    return shift_rgb(inp, params['r_shift'], params['g_shift'], params['b_shift'])\r\n  File \"/usr/local/lib/python3.8/dist-packages/kornia/enhance/shift_rgb.py\", line 17, in shift_rgb\r\n    shifted = (image + torch.Tensor(shifts).view(1, 3, 1, 1).to(image)).clamp_(min=0, max=1)\r\nValueError: only one element tensors can be converted to Python scalars\r\n```\r\nafter checking the code I think the problem is that \r\n```\r\nshifts = [params['r_shift'], params['g_shift'], params['b_shift']]\r\nshifted = (image + torch.Tensor(shifts).view(1, 3, 1, 1).to(image)).clamp_(min=0, max=1)\r\n```\r\nand also I am not sure about `.view(1,3,1,1)` shouldn't it be `.view(-1,3,1,1)`\r\n\r\n### Reproduction steps\r\n\r\n```bash\r\n1. setting up RandomRGBShift augmentation\r\n2. Using RandomRGBShift augmentation with gpus and batchsize > 1\r\n```\r\n\r\n\r\n### Expected behavior\r\n\r\n```\r\n  File \"/usr/local/lib/python3.8/dist-packages/kornia/augmentation/_2d/intensity/random_rgb_shift.py\", line 100, in apply_transform\r\n    return shift_rgb(inp, params['r_shift'], params['g_shift'], params['b_shift'])\r\n  File \"/usr/local/lib/python3.8/dist-packages/kornia/enhance/shift_rgb.py\", line 17, in shift_rgb\r\n    shifted = (image + torch.Tensor(shifts).view(1, 3, 1, 1).to(image)).clamp_(min=0, max=1)\r\nValueError: only one element tensors can be converted to Python scalars\r\n```\r\n\r\n### Environment\r\n\r\n```shell\r\n- PyTorch Version : 1.10\r\n- Linux\r\n- How you installed PyTorch (`pip`):\r\n- Python version: 3.8\r\n- cuda:11.3.0-cudnn8\r\n```\r\n\r\n\r\n### Additional context\r\n\r\n_No response_\n", "before_files": [{"content": "import torch\n\nfrom kornia.testing import KORNIA_CHECK_IS_COLOR, KORNIA_CHECK_IS_TENSOR\n\n\ndef shift_rgb(image: torch.Tensor, r_shift: torch.Tensor, g_shift: torch.Tensor, b_shift: torch.Tensor) -> torch.Tensor:\n    \"\"\"Shift rgb channels.\n\n    Shift each image's channel by either r_shift for red, g_shift for green and b_shift for blue channels.\n    \"\"\"\n\n    KORNIA_CHECK_IS_TENSOR(image)\n    KORNIA_CHECK_IS_COLOR(image, f\"with shape {image.shape}\")\n\n    shifts = [r_shift, g_shift, b_shift]\n\n    shifted = (image + torch.Tensor(shifts).view(1, 3, 1, 1).to(image)).clamp_(min=0, max=1)\n\n    return shifted\n", "path": "kornia/enhance/shift_rgb.py"}], "after_files": [{"content": "import torch\n\nfrom kornia.testing import KORNIA_CHECK_IS_COLOR, KORNIA_CHECK_IS_TENSOR\n\n\ndef shift_rgb(image: torch.Tensor, r_shift: torch.Tensor, g_shift: torch.Tensor, b_shift: torch.Tensor) -> torch.Tensor:\n    \"\"\"Shift rgb channels.\n\n    Shift each image's channel by either r_shift for red, g_shift for green and b_shift for blue channels.\n    \"\"\"\n\n    KORNIA_CHECK_IS_TENSOR(image)\n    KORNIA_CHECK_IS_COLOR(image, f\"with shape {image.shape}\")\n\n    shifts = [r_shift, g_shift, b_shift]\n\n    shifted = (image + torch.stack(shifts).view(-1, 3, 1, 1).to(image)).clamp_(min=0, max=1)\n\n    return shifted\n", "path": "kornia/enhance/shift_rgb.py"}]}