diff --git a/paddle/fluid/operators/mean_op.cu b/paddle/fluid/operators/mean_op.cu index 5a0afb68d63f1b99658fc649c33c5831cfcf35b5..63b5b871aabb5424ae6c8636ed40c0e5aa547205 100644 --- a/paddle/fluid/operators/mean_op.cu +++ b/paddle/fluid/operators/mean_op.cu @@ -59,8 +59,7 @@ class MeanCUDAKernel : public framework::OpKernel { return; } - using MT = typename details::MPTypeTrait::Type; - using Div = kernel_primitives::DivideFunctor; + using Div = kernel_primitives::DivideFunctor; std::vector reduce_dims; reduce_dims.reserve(rank); for (decltype(rank) i = 0; i < rank; ++i) { diff --git a/paddle/pten/kernels/gpu/math_kernel.cu b/paddle/pten/kernels/gpu/math_kernel.cu index 80931db56c3debaab6720b5dd7ec338da8040642..d7a16ac49b1c9d191cfe4c1799bc3de4e72d8529 100644 --- a/paddle/pten/kernels/gpu/math_kernel.cu +++ b/paddle/pten/kernels/gpu/math_kernel.cu @@ -52,21 +52,6 @@ namespace pten { dev_ctx, inputs, &outputs, axis, funcs::name##Functor()); \ } -/** - * Util Functors - */ - -template -struct DivideFunctor { - HOSTDEVICE explicit inline DivideFunctor(int n) - : n_inv(static_cast(1.0 / n)) {} - - HOSTDEVICE inline T operator()(const T x) const { return x * n_inv; } - - private: - T n_inv; -}; - /** * Kernels */