mirror of
https://github.com/saymrwulf/pytorch.git
synced 2026-05-14 20:57:59 +00:00
[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:
parent
b133907d0a
commit
2a55311773
1 changed files with 3 additions and 4 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue