10000 [cuda] Simplify the sinc function a bit. (#146774) · pytorch/pytorch@2a55311 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2a55311

Browse files
dccipytorchmergebot
authored andcommitted
[cuda] Simplify the sinc function a bit. (#146774)
`else` after `return` can be removed & the indentation can be reduced, for readability. Pull Request resolved: #146774 Approved by: https://github.com/malfet
1 parent b133907 commit 2a55311

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

aten/src/ATen/native/cuda/Math.cuh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -758,11 +758,10 @@ const auto sinc_string = jiterator_stringify(
758758
T sinc(T a) {
759759
if (a == T(0)) {
760760
return T(1);
761-
} else {
762-
constexpr T pi = T(3.14159265358979323846L);
763-
T product = pi * a;
764-
return std::sin(product) / product;
765761
}
762+
constexpr T pi = T(3.14159265358979323846L);
763+
T product = pi * a;
764+
return std::sin(product) / product;
766765
}
767766
); // sinc_string
768767

0 commit comments

Comments
 (0)
0