π Geometric Computer Vision Library for Spatial AI
Python artificial-intelligencecomputer-visiondeep-learninghacktoberfestimage-processingmachine-learningneural-networkpythonpytorchroboticsspatial-ai
The isinstance checks order are inverted (#2192)
Cesar Aybard2d9030c7931
diff --git a/kornia/metrics/psnr.py b/kornia/metrics/psnr.pyindex 19b0d3382..549cacbf3 100644--- a/kornia/metrics/psnr.py+++ b/kornia/metrics/psnr.py@@ -38,10 +38,10 @@ def psnr(input: torch.Tensor, target: torch.Tensor, max_val: float) -> torch.Tenhttps://en.wikipedia.org/wiki/Peak_signal-to-noise_ratio#Definition"""if not isinstance(input, torch.Tensor):- raise TypeError(f"Expected torch.Tensor but got {type(target)}.")+ raise TypeError(f"Expected torch.Tensor but got {type(input)}.")if not isinstance(target, torch.Tensor):- raise TypeError(f"Expected torch.Tensor but got {type(input)}.")+ raise TypeError(f"Expected torch.Tensor but got {type(target)}.")if input.shape != target.shape:raise TypeError(f"Expected tensors of equal shapes, but got {input.shape} and {target.shape}")