π Geometric Computer Vision Library for Spatial AI
Python artificial-intelligencecomputer-visiondeep-learninghacktoberfestimage-processingmachine-learningneural-networkpythonpytorchroboticsspatial-ai
Fix of possible CPU and GPU device error (#2838)
Michaela14319cc8c4e
diff --git a/kornia/filters/kernels.py b/kornia/filters/kernels.pyindex ff40d32b1..6b24568b2 100644--- a/kornia/filters/kernels.py+++ b/kornia/filters/kernels.py@@ -89,7 +89,7 @@ def gaussian(mean = float(window_size // 2) if mean is None else meanif isinstance(mean, float):- mean = tensor([[mean]], device=device, dtype=dtype)+ mean = tensor([[mean]], device=sigma.device, dtype=sigma.dtype)KORNIA_CHECK_IS_TENSOR(mean)KORNIA_CHECK_SHAPE(mean, ["B", "1"])