diff --git a/paddle/fluid/framework/details/nan_inf_utils_detail.cu b/paddle/fluid/framework/details/nan_inf_utils_detail.cu index 0317e55909cd23fcc047f70c96687eed499c330d..44668e491eb29106d6863685180574a936bca35a 100644 --- a/paddle/fluid/framework/details/nan_inf_utils_detail.cu +++ b/paddle/fluid/framework/details/nan_inf_utils_detail.cu @@ -167,7 +167,9 @@ void TensorCheckerVisitor::apply( } const size_t threads = 1024; - size_t blocks = std::min(128ul, (tensor_.numel() + threads - 1) / threads); + size_t blocks = + std::min(static_cast(128), + static_cast((tensor_.numel() + threads - 1) / threads)); CheckNanInfKernel<<stream()>>>( tensor_.data(), tensor_.numel(), print_num, gpu_str_ptr); }