Skip to content

Commit

Permalink
Fix compilation error
Browse files Browse the repository at this point in the history
  • Loading branch information
fengyuan14 committed Jul 12, 2024
1 parent 1eba5ef commit f919752
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/ATen/native/xpu/sycl/ActivationLogSigmoidKernels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ struct LogSigmoidBackwardFunctor {
const opmath_t in = in_;
const opmath_t grad_out = grad_out_;

auto in_negative = in < opmath_t(0);
auto max_deriv = in_negative ? opmath_t(1) : opmath_t(0);
auto sign = in_negative ? opmath_t(1) : -opmath_t(1);
const auto z = std::exp(-std::abs(in));
bool in_negative = in < opmath_t(0);
opmath_t max_deriv = in_negative ? opmath_t(1) : opmath_t(0);
opmath_t sign = in_negative ? opmath_t(1) : -opmath_t(1);
const opmath_t z = std::exp(-std::abs(in));
return grad_out * (max_deriv - sign * (z / (opmath_t(1) + z)));
}
};
Expand All @@ -52,4 +52,4 @@ void log_sigmoid_backward_kernel(TensorIteratorBase& iter) {
[&]() { gpu_kernel(iter, LogSigmoidBackwardFunctor<scalar_t>()); });
}

} // namespace at::native::xpu
} // namespace at::native::xpu

0 comments on commit f919752

Please sign in to comment.