diff --git a/.clang-tidy b/.clang-tidy index 23da1367f9f5376736c84cd475c1f880198319d0..e25b6d33bdcfbc18d96c25e86b0ada307ddc8bbd 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -58,7 +58,7 @@ bugprone-unused-raii, -clang-analyzer-core.NullDereference, -clang-analyzer-core.StackAddrEscapeBase, -clang-analyzer-core.StackAddressEscape, --clang-analyzer-core.UndefinedBinaryOperatorResult, +clang-analyzer-core.UndefinedBinaryOperatorResult, -clang-analyzer-core.VLASize, -clang-analyzer-core.builtin.BuiltinFunctions, -clang-analyzer-core.builtin.NoReturnFunctions, diff --git a/paddle/phi/kernels/funcs/activation_functor.h b/paddle/phi/kernels/funcs/activation_functor.h index 1d3bde7ab59d54d4ed856e516eb3c097351f523f..926920dfa93dddbd3f67fd9adefab14958bb6993 100644 --- a/paddle/phi/kernels/funcs/activation_functor.h +++ b/paddle/phi/kernels/funcs/activation_functor.h @@ -1488,7 +1488,7 @@ struct LeakyReluFunctor : public BaseActivationFunctor { template void operator()(Device d, X x, Out out) const { - if (alpha < 1.f) { + if (alpha < 1.f) { // NOLINT out.device(d) = x.cwiseMax(static_cast(alpha) * x); } else { out.device(d) = x.cwiseMin(static_cast(alpha) * x); @@ -1653,7 +1653,7 @@ struct HardShrinkFunctor : public BaseActivationFunctor { } template void operator()(Device d, X x, Out out) const { - auto temp1 = x < static_cast(threshold * -1.f); + auto temp1 = x < static_cast(threshold * -1.f); // NOLINT auto temp2 = x > static_cast(threshold); out.device(d) = x * (temp1 || temp2).template cast(); } @@ -1673,7 +1673,7 @@ struct HardShrinkGradFunctor : public BaseActivationFunctor { typename dOut, typename dX> void operator()(Device d, X x, Out out UNUSED, dOut dout, dX dx) const { - auto temp1 = x < static_cast(threshold * -1.f); + auto temp1 = x < static_cast(threshold * -1.f); // NOLINT auto temp2 = x > static_cast(threshold); dx.device(d) = dout * (temp1 || temp2).template cast(); } @@ -2565,7 +2565,7 @@ struct CELUGradFunctor : public BaseActivationFunctor { typename dOut, typename dX> void operator()(Device d, X x, Out out UNUSED, dOut dout, dX dx) const { - auto temp_a_pos = static_cast(alpha > 0); + auto temp_a_pos = static_cast(alpha > 0); // NOLINT auto temp_a_neg = static_cast(alpha <= 0); auto temp_x_pos = (x > static_cast(0)).template cast(); auto temp_x_neg = (x <= static_cast(0)).template cast();