prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Update `make test-all`
  ```Makefile
  # TODO: Add cuda-float16 when #649 is solved
  test-all: FORCE
  	pytest -v --device all --dtype float32,float64 --cov=kornia test/ --flake8 --mypy
  ```
  Maybe instead of just adding `float16`, we can use `--dtype all`? (https://github.com/kornia/kornia/blob/5d1d8cc8c4fb3e398b429edd2cc25ef40d6299ce/conftest.py#L77)
  
  </issue>
  <code>
  [start of kornia/enhance/core.py]
  1 from kornia.core import Module, Tensor
  2 from kornia.testing import KORNIA_CHECK, KORNIA_CHECK_IS_TENSOR
  3 
  4 
  5 def add_weighted(src1: Tensor, alpha, src2: Tensor, beta, gamma) -> Tensor:
  6     r"""Calculate the weighted sum of two Tensors.
  7 
  8     .. image:: _static/img/add_weighted.png
  9 
  10     The function calculates the weighted sum of two Tensors as follows:
  11 
  12     .. math::
  13         out = src1 * alpha + src2 * beta + gamma
  14 
  15     Args:
  16         src1: Tensor with an arbitrary shape, equal to shape of src2.
  17         alpha: weight of the src1 elements as Union[float, Tensor].
  18         src2: Tensor with an arbitrary shape, equal to shape of src1.
  19         beta: weight of the src2 elements as Union[float, Tensor].
  20         gamma: scalar added to each sum as Union[float, Tensor].
  21 
  22     Returns:
  23         Weighted Tensor with shape equal to src1 and src2 shapes.
  24 
  25     Example:
  26         >>> input1 = torch.rand(1, 1, 5, 5)
  27         >>> input2 = torch.rand(1, 1, 5, 5)
  28         >>> output = add_weighted(input1, 0.5, input2, 0.5, 1.0)
  29         >>> output.shape
  30         torch.Size([1, 1, 5, 5])
  31 
  32     Notes:
  33         Tensor alpha/beta/gamma have to be with shape broadcastable to src1 and src2 shapes.
  34     """
  35     KORNIA_CHECK_IS_TENSOR(src1)
  36     KORNIA_CHECK_IS_TENSOR(src2)
  37     KORNIA_CHECK(src1.shape == src2.shape, f"src1 and src2 have different shapes. Got {src1.shape} and {src2.shape}")
  38     if isinstance(alpha, Tensor):
  39         KORNIA_CHECK(src1.shape == alpha.shape, "alpha has a different shape than src.")
  40     if isinstance(beta, Tensor):
  41         KORNIA_CHECK(src1.shape == beta.shape, "beta has a different shape than src.")
  42     if isinstance(gamma, Tensor):
  43         KORNIA_CHECK(src1.shape == gamma.shape, "gamma has a different shape than src.")
  44 
  45     return src1 * alpha + src2 * beta + gamma
  46 
  47 
  48 class AddWeighted(Module):
  49     r"""Calculate the weighted sum of two Tensors.
  50 
  51     The function calculates the weighted sum of two Tensors as follows:
  52 
  53     .. math::
  54         out = src1 * alpha + src2 * beta + gamma
  55 
  56     Args:
  57         alpha: weight of the src1 elements as Union[float, Tensor].
  58         beta: weight of the src2 elements as Union[float, Tensor].
  59         gamma: scalar added to each sum as Union[float, Tensor].
  60 
  61     Shape:
  62         - Input1: Tensor with an arbitrary shape, equal to shape of Input2.
  63         - Input2: Tensor with an arbitrary shape, equal to shape of Input1.
  64         - Output: Weighted tensor with shape equal to src1 and src2 shapes.
  65 
  66     Example:
  67         >>> input1 = torch.rand(1, 1, 5, 5)
  68         >>> input2 = torch.rand(1, 1, 5, 5)
  69         >>> output = AddWeighted(0.5, 0.5, 1.0)(input1, input2)
  70         >>> output.shape
  71         torch.Size([1, 1, 5, 5])
  72 
  73     Notes:
  74         Tensor alpha/beta/gamma have to be with shape broadcastable to src1 and src2 shapes.
  75     """
  76 
  77     def __init__(self, alpha, beta, gamma) -> None:
  78         super().__init__()
  79         self.alpha = alpha
  80         self.beta = beta
  81         self.gamma = gamma
  82 
  83     def forward(self, src1: Tensor, src2: Tensor) -> Tensor:
  84         return add_weighted(src1, self.alpha, src2, self.beta, self.gamma)
  85
  [end of kornia/enhance/core.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/kornia/enhance/core.py b/kornia/enhance/core.py
  --- a/kornia/enhance/core.py
  +++ b/kornia/enhance/core.py
  @@ -1,8 +1,12 @@
  -from kornia.core import Module, Tensor
  +from typing import Union
  +
  +from kornia.core import Module, Tensor, tensor
   from kornia.testing import KORNIA_CHECK, KORNIA_CHECK_IS_TENSOR
   
   
  -def add_weighted(src1: Tensor, alpha, src2: Tensor, beta, gamma) -> Tensor:
  +def add_weighted(
  +    src1: Tensor, alpha: Union[float, Tensor], src2: Tensor, beta: Union[float, Tensor], gamma: Union[float, Tensor]
  +) -> Tensor:
       r"""Calculate the weighted sum of two Tensors.
   
       .. image:: _static/img/add_weighted.png
  @@ -35,12 +39,21 @@
       KORNIA_CHECK_IS_TENSOR(src1)
       KORNIA_CHECK_IS_TENSOR(src2)
       KORNIA_CHECK(src1.shape == src2.shape, f"src1 and src2 have different shapes. Got {src1.shape} and {src2.shape}")
  +
       if isinstance(alpha, Tensor):
           KORNIA_CHECK(src1.shape == alpha.shape, "alpha has a different shape than src.")
  +    else:
  +        alpha = tensor(alpha, dtype=src1.dtype, device=src1.device)
  +
       if isinstance(beta, Tensor):
           KORNIA_CHECK(src1.shape == beta.shape, "beta has a different shape than src.")
  +    else:
  +        beta = tensor(beta, dtype=src1.dtype, device=src1.device)
  +
       if isinstance(gamma, Tensor):
           KORNIA_CHECK(src1.shape == gamma.shape, "gamma has a different shape than src.")
  +    else:
  +        gamma = tensor(gamma, dtype=src1.dtype, device=src1.device)
   
       return src1 * alpha + src2 * beta + gamma
  
verification_info: {"golden_diff": "diff --git a/kornia/enhance/core.py b/kornia/enhance/core.py\n--- a/kornia/enhance/core.py\n+++ b/kornia/enhance/core.py\n@@ -1,8 +1,12 @@\n-from kornia.core import Module, Tensor\n+from typing import Union\n+\n+from kornia.core import Module, Tensor, tensor\n from kornia.testing import KORNIA_CHECK, KORNIA_CHECK_IS_TENSOR\n \n \n-def add_weighted(src1: Tensor, alpha, src2: Tensor, beta, gamma) -> Tensor:\n+def add_weighted(\n+    src1: Tensor, alpha: Union[float, Tensor], src2: Tensor, beta: Union[float, Tensor], gamma: Union[float, Tensor]\n+) -> Tensor:\n     r\"\"\"Calculate the weighted sum of two Tensors.\n \n     .. image:: _static/img/add_weighted.png\n@@ -35,12 +39,21 @@\n     KORNIA_CHECK_IS_TENSOR(src1)\n     KORNIA_CHECK_IS_TENSOR(src2)\n     KORNIA_CHECK(src1.shape == src2.shape, f\"src1 and src2 have different shapes. Got {src1.shape} and {src2.shape}\")\n+\n     if isinstance(alpha, Tensor):\n         KORNIA_CHECK(src1.shape == alpha.shape, \"alpha has a different shape than src.\")\n+    else:\n+        alpha = tensor(alpha, dtype=src1.dtype, device=src1.device)\n+\n     if isinstance(beta, Tensor):\n         KORNIA_CHECK(src1.shape == beta.shape, \"beta has a different shape than src.\")\n+    else:\n+        beta = tensor(beta, dtype=src1.dtype, device=src1.device)\n+\n     if isinstance(gamma, Tensor):\n         KORNIA_CHECK(src1.shape == gamma.shape, \"gamma has a different shape than src.\")\n+    else:\n+        gamma = tensor(gamma, dtype=src1.dtype, device=src1.device)\n \n     return src1 * alpha + src2 * beta + gamma\n", "issue": "Update `make test-all`\n```Makefile\r\n# TODO: Add cuda-float16 when #649 is solved\r\ntest-all: FORCE\r\n\tpytest -v --device all --dtype float32,float64 --cov=kornia test/ --flake8 --mypy\r\n```\r\nMaybe instead of just adding `float16`, we can use `--dtype all`? (https://github.com/kornia/kornia/blob/5d1d8cc8c4fb3e398b429edd2cc25ef40d6299ce/conftest.py#L77)\n", "before_files": [{"content": "from kornia.core import Module, Tensor\nfrom kornia.testing import KORNIA_CHECK, KORNIA_CHECK_IS_TENSOR\n\n\ndef add_weighted(src1: Tensor, alpha, src2: Tensor, beta, gamma) -> Tensor:\n    r\"\"\"Calculate the weighted sum of two Tensors.\n\n    .. image:: _static/img/add_weighted.png\n\n    The function calculates the weighted sum of two Tensors as follows:\n\n    .. math::\n        out = src1 * alpha + src2 * beta + gamma\n\n    Args:\n        src1: Tensor with an arbitrary shape, equal to shape of src2.\n        alpha: weight of the src1 elements as Union[float, Tensor].\n        src2: Tensor with an arbitrary shape, equal to shape of src1.\n        beta: weight of the src2 elements as Union[float, Tensor].\n        gamma: scalar added to each sum as Union[float, Tensor].\n\n    Returns:\n        Weighted Tensor with shape equal to src1 and src2 shapes.\n\n    Example:\n        >>> input1 = torch.rand(1, 1, 5, 5)\n        >>> input2 = torch.rand(1, 1, 5, 5)\n        >>> output = add_weighted(input1, 0.5, input2, 0.5, 1.0)\n        >>> output.shape\n        torch.Size([1, 1, 5, 5])\n\n    Notes:\n        Tensor alpha/beta/gamma have to be with shape broadcastable to src1 and src2 shapes.\n    \"\"\"\n    KORNIA_CHECK_IS_TENSOR(src1)\n    KORNIA_CHECK_IS_TENSOR(src2)\n    KORNIA_CHECK(src1.shape == src2.shape, f\"src1 and src2 have different shapes. Got {src1.shape} and {src2.shape}\")\n    if isinstance(alpha, Tensor):\n        KORNIA_CHECK(src1.shape == alpha.shape, \"alpha has a different shape than src.\")\n    if isinstance(beta, Tensor):\n        KORNIA_CHECK(src1.shape == beta.shape, \"beta has a different shape than src.\")\n    if isinstance(gamma, Tensor):\n        KORNIA_CHECK(src1.shape == gamma.shape, \"gamma has a different shape than src.\")\n\n    return src1 * alpha + src2 * beta + gamma\n\n\nclass AddWeighted(Module):\n    r\"\"\"Calculate the weighted sum of two Tensors.\n\n    The function calculates the weighted sum of two Tensors as follows:\n\n    .. math::\n        out = src1 * alpha + src2 * beta + gamma\n\n    Args:\n        alpha: weight of the src1 elements as Union[float, Tensor].\n        beta: weight of the src2 elements as Union[float, Tensor].\n        gamma: scalar added to each sum as Union[float, Tensor].\n\n    Shape:\n        - Input1: Tensor with an arbitrary shape, equal to shape of Input2.\n        - Input2: Tensor with an arbitrary shape, equal to shape of Input1.\n        - Output: Weighted tensor with shape equal to src1 and src2 shapes.\n\n    Example:\n        >>> input1 = torch.rand(1, 1, 5, 5)\n        >>> input2 = torch.rand(1, 1, 5, 5)\n        >>> output = AddWeighted(0.5, 0.5, 1.0)(input1, input2)\n        >>> output.shape\n        torch.Size([1, 1, 5, 5])\n\n    Notes:\n        Tensor alpha/beta/gamma have to be with shape broadcastable to src1 and src2 shapes.\n    \"\"\"\n\n    def __init__(self, alpha, beta, gamma) -> None:\n        super().__init__()\n        self.alpha = alpha\n        self.beta = beta\n        self.gamma = gamma\n\n    def forward(self, src1: Tensor, src2: Tensor) -> Tensor:\n        return add_weighted(src1, self.alpha, src2, self.beta, self.gamma)\n", "path": "kornia/enhance/core.py"}]}