Skip to content

🐍 Geometric Computer Vision Library for Spatial AI

revert torch.amin to torch.min (#977)

Edgar Riba76c87bee0f72
diff --git a/kornia/morphology/basic_operators.py b/kornia/morphology/basic_operators.py
index d8f5b77bd..3f32e9ba6 100644
--- a/kornia/morphology/basic_operators.py
+++ b/kornia/morphology/basic_operators.py
@@ -86,6 +86,7 @@ def erosion(tensor: torch.Tensor, kernel: torch.Tensor) -> torch.Tensor:
tensor.shape[0] * tensor.shape[1], 1, tensor.shape[2], tensor.shape[3])
output = F.pad(output, pad_e, mode='constant', value=1.)
output = F.conv2d(output, kernel_e) - se_e.view(1, -1, 1, 1)
- output = output.amin(1)
+ # TODO: upgrade to: `output = torch.amin(output, dim=1)` after dropping pytorch 1.6 support
+ output = torch.min(output, dim=1)[0]
return output.view_as(tensor)