Skip to content

🐍 Geometric Computer Vision Library for Spatial AI

typing

Dmytro Mishkinf5ab573242a8
diff --git a/kornia/filters/sobel.py b/kornia/filters/sobel.py
index 317052967..c7dc2ee8b 100644
--- a/kornia/filters/sobel.py
+++ b/kornia/filters/sobel.py
@@ -41,8 +41,8 @@ class SpatialGradient(nn.Module):
# convolve input tensor with sobel kernel
kernel_flip: torch.Tensor = kernel.flip(-3)
# Pad with "replicate for spatial dims, but with zeros for channel dim
- padded_inp = F.pad(F.pad(input, [1, 1, 1, 1], 'replicate')[:, :, None],
- [0, 0, 0, 0, 1, 1], 'constant', 0)
+ padded_inp: torch.Tensor = F.pad(F.pad(input, [1, 1, 1, 1], 'replicate')[:, :, None], # noqa
+ [0, 0, 0, 0, 1, 1], 'constant', 0)
return F.conv3d(padded_inp, kernel_flip, padding=0, groups=c)