Skip to content

🐍 Geometric Computer Vision Library for Spatial AI

1.5.1 specific bug fix (#813)

shijianjian93dafbad95ce
diff --git a/kornia/enhance/adjust.py b/kornia/enhance/adjust.py
index f559a5cce..c07a4f6a3 100644
--- a/kornia/enhance/adjust.py
+++ b/kornia/enhance/adjust.py
@@ -638,7 +638,7 @@ def _build_lut(histo, step):
# and then normalization by step.
lut = (torch.cumsum(histo, 0) + (step // 2)) // step
# Shift lut, prepending with 0.
- lut = torch.cat([torch.zeros(1, device=lut.device), lut[:-1]])
+ lut = torch.cat([torch.zeros(1, device=lut.device, dtype=lut.dtype), lut[:-1]])
# Clip the counts to be in range. This is done
# in the C code for image.point.
return torch.clamp(lut, 0, 255)