[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
This commit is contained in:
Davide Italiano 2025-02-09 20:09:34 +00:00 committed by PyTorch MergeBot
parent b133907d0a
commit 2a55311773

View file

@ -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