π Geometric Computer Vision Library for Spatial AI
Python artificial-intelligencecomputer-visiondeep-learninghacktoberfestimage-processingmachine-learningneural-networkpythonpytorchroboticsspatial-ai
Remove unnecessary comprehension (#1081)
deepsource-autofix[bot]6f24b8e53175
diff --git a/kornia/augmentation/utils/param_validation.py b/kornia/augmentation/utils/param_validation.pyindex 4ab49efe1..dac5f15f4 100644--- a/kornia/augmentation/utils/param_validation.py+++ b/kornia/augmentation/utils/param_validation.py@@ -128,14 +128,14 @@ def _tuple_range_reader(elif (isinstance(input_range, (tuple, list))and len(input_range) == target_shape[0]- and all([isinstance(x, (float, int)) for x in input_range])+ and all(isinstance(x, (float, int)) for x in input_range)):input_range_tmp = torch.tensor([(-s, s) for s in input_range], device=device, dtype=dtype)elif (isinstance(input_range, (tuple, list))and len(input_range) == target_shape[0]- and all([isinstance(x, (tuple, list)) for x in input_range])+ and all(isinstance(x, (tuple, list)) for x in input_range)):input_range_tmp = torch.tensor(input_range, device=device, dtype=dtype)diff --git a/kornia/geometry/transform/imgwarp.py b/kornia/geometry/transform/imgwarp.pyindex d17eaf7c5..3956aa771 100644--- a/kornia/geometry/transform/imgwarp.py+++ b/kornia/geometry/transform/imgwarp.py@@ -574,7 +574,7 @@ def get_affine_matrix2d(# pad transform to get Bx3x3transform_h = convert_affinematrix_to_homography(transform)- if any([s is not None for s in [sx, sy]]):+ if any(s is not None for s in [sx, sy]):shear_mat = get_shear_matrix2d(center, sx, sy)transform_h = transform_h @ shear_mat@@ -678,7 +678,7 @@ def get_affine_matrix3d(# pad transform to get Bx3x3transform_h = convert_affinematrix_to_homography3d(transform)- if any([s is not None for s in [sxy, sxz, syx, syz, szx, szy]]):+ if any(s is not None for s in [sxy, sxz, syx, syz, szx, szy]):shear_mat = get_shear_matrix3d(center, sxy, sxz, syx, syz, szx, szy)transform_h = transform_h @ shear_mat