Skip to content

🐍 Geometric Computer Vision Library for Spatial AI

Remove unnecessary use of comprehension (#1220)

deepsource-autofix[bot]7b1d0d57c2dd
diff --git a/kornia/feature/defmo.py b/kornia/feature/defmo.py
index a149e0a7d..ebd7d9345 100644
--- a/kornia/feature/defmo.py
+++ b/kornia/feature/defmo.py
@@ -243,7 +243,9 @@ class RenderingDeFMO(nn.Module):
renders = []
for ki in range(times.shape[1]):
t_tensor = (
- times[[x for x in range(times.shape[0])], ki]
+ # TODO: replace by after deprecate pytorch 1.6
+ # times[list(range(times.shape[0])), ki]
+ times[[x for x in range(times.shape[0])], ki] # skipcq: PYL-R1721
.unsqueeze(-1)
.unsqueeze(-1)
.unsqueeze(-1)