π Geometric Computer Vision Library for Spatial AI
Python artificial-intelligencecomputer-visiondeep-learninghacktoberfestimage-processingmachine-learningneural-networkpythonpytorchroboticsspatial-ai
remove duplicated temperature multiplication
Edgar Riba61bdd3b3ed6a
diff --git a/kornia/contrib/spatial_soft_argmax2d.py b/kornia/contrib/spatial_soft_argmax2d.pyindex 9f7ce4adb..7ac9c72df 100644--- a/kornia/contrib/spatial_soft_argmax2d.py+++ b/kornia/contrib/spatial_soft_argmax2d.py@@ -44,7 +44,7 @@ def spatial_soft_argmax2d(.format(input.shape))# unpack shapes and create view from input tensorbatch_size, channels, height, width = input.shape- x: torch.Tensor = temperature * input.view(batch_size, channels, -1)+ x: torch.Tensor = input.view(batch_size, channels, -1)# compute softmax along the feature mapx_soft: torch.Tensor = F.softmax(x * temperature, dim=-1)