8000 fix complex support · pytorch/pytorch@65a038f · GitHub
[go: up one dir, main page]

Skip to content

Commit 65a038f

Browse files
committed
fix complex support
1 parent eb96330 commit 65a038f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

aten/src/ATen/cuda/llvm_complex.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -751,26 +751,26 @@ complex<_Tp>
751751
reciprocal(const complex<_Tp>& __x)
752752
{
753753
// Handle extreme cases for numpy compatibility
754-
auto both_inf = [](T real, T imag) {
754+
auto both_inf = [](_Tp real, _Tp imag) {
755755
return isinf(real) && isinf(imag);
756756
}
757757
758-
auto either_inf = [](T real, T imag) {
758+
auto either_inf = [](_Tp real, _Tp imag) {
759759
return isinf(real) || isinf(imag);
760760
}
761761
762-
auto either_nan = [](T real, T imag) {
762+
auto either_nan = [](_Tp real, _Tp imag) {
763763
return isnan(real) || isnan(imag);
764764
}
765765
766766
if (either_nan(__x.real(), __x.imag()) || both_inf(__x.real(), __x.imag())) {
767767
// If either is Nan or both are infinite, return {nan, nan}
768-
return {std::numeric_limits<T>::quiet_NaN(), std::numeric_limits<T>::quiet_NaN()};
768+
return {std::numeric_limits<_Tp>::quiet_NaN(), std::numeric_limits<_Tp>::quiet_NaN()};
769769
} else if (either_inf(__x.real(), __x.imag())) {
770770
// If either is Inf, return {0, 0}
771771
return {0, 0};
772772
}
773-
const complex<T> one = complex<T>(1.0, 0);
773+
const complex<_Tp> one = complex<_Tp>(1.0, 0);
774774
return one/__x;
775775
}
776776

0 commit comments

Comments
 (0)
0