Skip to content

🐍 Geometric Computer Vision Library for Spatial AI

fix _adapted_uniform (#677)

Philip Meierbdc47994f0bd
diff --git a/kornia/augmentation/utils/helpers.py b/kornia/augmentation/utils/helpers.py
index 0f104244d..4f7ea0a58 100644
--- a/kornia/augmentation/utils/helpers.py
+++ b/kornia/augmentation/utils/helpers.py
@@ -127,7 +127,7 @@ def _adapted_uniform(
high = torch.tensor(high, dtype=torch.float32)
dist = Uniform(low, high)
if same_on_batch:
- return dist.rsample((1, *shape[1:])).repeat(shape[0])
+ return dist.rsample((1, *shape[1:])).repeat(shape[0], *[1] * (len(shape) - 1))
else:
return dist.rsample(shape)