diff --git a/lite/kernels/x86/reduce_op_function.h b/lite/kernels/x86/reduce_op_function.h index a6d4b899a59146d72b8093cb559cb8fe0861f966..adfe4668437cee4ec3ea24a25be91c1009918861 100644 --- a/lite/kernels/x86/reduce_op_function.h +++ b/lite/kernels/x86/reduce_op_function.h @@ -63,9 +63,7 @@ void ReduceFunctor(const lite::Tensor& input, auto out = EigenScalar::From(output); functor(&x, &out, reduce_dim); } else { - auto fun_name = typeid(Functor).name(); - const char* sum_fun = "SumFunctor"; - auto te = strstr(fun_name, sum_fun); + auto te = strstr(typeid(Functor).name(), "SumFunctor"); if (D == 3 && R_D == 1 && te != NULL) { lite::DDim input_dims = input.dims(); const T* input_data = input.data();