8000 [jiterator] reciprocal: complex by khushi-411 · Pull Request #74973 · pytorch/pytorch · GitHub
[go: up one dir, main page]

Skip to content

[jiterator] reciprocal: complex #74973

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 18 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
;
  • Loading branch information
khushi-411 committed Apr 19, 2022
commit 69a8b64d34ed2587aed058ede2fed8ad069f518f
6 changes: 3 additions & 3 deletions aten/src/ATen/cuda/llvm_complex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -753,15 +753,15 @@ reciprocal(const complex<_Tp>& __x)
// Handle extreme cases for numpy compatibility
auto both_inf = [](_Tp real, _Tp imag) {
return isinf(real) && isinf(imag);
}
};

auto either_inf = [](_Tp real, _Tp imag) {
return isinf(real) || isinf(imag);
}
};

auto either_nan = [](_Tp real, _Tp imag) {
return isnan(real) || isnan(imag);
}
};

if (either_nan(__x.real(), __x.imag()) || both_inf(__x.real(), __x.imag())) {
// If either is Nan or both are infinite, return {nan, nan}
Expand Down
0