From 2a55311773bfb9e569aa672ac3322d21abc1af32 Mon Sep 17 00:00:00 2001 From: Davide Italiano Date: Sun, 9 Feb 2025 20:09:34 +0000 Subject: [PATCH] [cuda] Simplify the sinc function a bit. (#146774) `else` after `return` can be removed & the indentation can be reduced, for readability. Pull Request resolved: https://github.com/pytorch/pytorch/pull/146774 Approved by: https://github.com/malfet --- aten/src/ATen/native/cuda/Math.cuh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/aten/src/ATen/native/cuda/Math.cuh b/aten/src/ATen/native/cuda/Math.cuh index b99e9d0c94d..2fe8f5dd2e3 100644 --- a/aten/src/ATen/native/cuda/Math.cuh +++ b/aten/src/ATen/native/cuda/Math.cuh @@ -758,11 +758,10 @@ const auto sinc_string = jiterator_stringify( T sinc(T a) { if (a == T(0)) { return T(1); - } else { - constexpr T pi = T(3.14159265358979323846L); - T product = pi * a; - return std::sin(product) / product; } + constexpr T pi = T(3.14159265358979323846L); + T product = pi * a; + return std::sin(product) / product; } ); // sinc_string