@@ -104,18 +104,18 @@ void reciprocal_kernel_cuda(TensorIteratorBase& iter) {
104
104
#if AT_USE_JITERATOR()
105
105
static const auto reciprocal_string = jiterator_stringify (
106
106
template <typename T>
107
- T reciprocal_kernel (c10::complex<T> v) {
107
+ T reciprocal_kernel (T v) {
108
108
// Handle extreme cases for numpy compatibility
109
109
auto both_inf = [](T real, T imag) {
110
- return ::isinf (real) && ::isinf (imag);
110
+ return std ::isinf (real) && std ::isinf (imag);
111
111
};
112
112
113
113
auto either_inf = [](T real, T imag) {
114
- return ::isinf (real) || ::isinf (imag);
114
+ return std ::isinf (real) || std ::isinf (imag);
115
115
};
116
116
117
117
auto either_nan = [](T real, T imag) {
118
- return ::isnan (real) || ::isnan (imag);
118
+ return std ::isnan (real) || std ::isnan (imag);
119
119
};
120
120
121
121
if (either_nan (v.real (), v.imag ()) || both_inf (v.real (), v.imag ())) {
@@ -138,7 +138,7 @@ void reciprocal_kernel_cuda(TensorIteratorBase& iter) {
138
138
});
139
139
#else
140
140
AT_DISPATCH_COMPLEX_TYPES (dtype, " reciprocal_cuda" , [&]() {
141
- gpu_kernel (iter, []GPU_LAMBDA (scalar_t a) {
141
+ gpu_kernel (iter, []GPU_LAMBDA (scalar_t a) -> scalar_t {
142
142
return reciprocal_wrapper (a);
143
143
});
144
144
});
0 commit comments