Skip to content

🐍 Geometric Computer Vision Library for Spatial AI

Add comments to test

ananyamukh65d1cae3232cc
diff --git a/test/test_losses.py b/test/test_losses.py
index 2748af938..2f8614f48 100644
--- a/test/test_losses.py
+++ b/test/test_losses.py
@@ -362,11 +362,15 @@ class TestPSNR:
assert pytest.approx(loss.item(), float('inf'))
def test_type(self):
+ # Expecting an exception
+ # since we pass integers instead of torch tensors
criterion = kornia.losses.PSNR(1.0)
with pytest.raises(Exception) as e:
criterion(1, 2)
def test_shape(self):
+ # Expecting an exception
+ # since we pass tensors of different shapes
criterion = kornia.losses.PSNR(1.0)
with pytest.raises(Exception) as e:
criterion(torch.rand(2, 3, 3, 2), torch.rand(2, 3, 3))