Skip to content

🐍 Geometric Computer Vision Library for Spatial AI

added device call to kernel creation (#760)

Jim Bohnslava9a6aec86c17
diff --git a/kornia/enhance/adjust.py b/kornia/enhance/adjust.py
index cbe969bd9..2141f6c7a 100644
--- a/kornia/enhance/adjust.py
+++ b/kornia/enhance/adjust.py
@@ -419,7 +419,7 @@ def sharpness(input: torch.Tensor, factor: Union[float, torch.Tensor]) -> torch.
[1, 1, 1],
[1, 5, 1],
[1, 1, 1]
- ], dtype=input.dtype).view(1, 1, 3, 3).repeat(3, 1, 1, 1)
+ ], dtype=input.dtype, device=input.device).view(1, 1, 3, 3).repeat(3, 1, 1, 1)
# This shall be equivalent to depthwise conv2d:
# Ref: https://discuss.pytorch.org/t/depthwise-and-separable-convolutions-in-pytorch/7315/2