diff --git a/paddle/operators/accuracy_op.cu b/paddle/operators/accuracy_op.cu
index ccb2c06c22570c9f90c52f8950d40382b2cb6543..1776f33105367447759aa91c25263dfc53bd2f99 100644
--- a/paddle/operators/accuracy_op.cu
+++ b/paddle/operators/accuracy_op.cu
@@ -14,7 +14,6 @@ limitations under the License. */
 
 #include <thrust/execution_policy.h>
 #include <thrust/reduce.h>
-#include <iostream>
 #include "paddle/operators/accuracy_op.h"
 #include "paddle/platform/cuda_helper.h"
 
@@ -66,8 +65,7 @@ class AccuracyOpCUDAKernel : public framework::OpKernel<T> {
 
     size_t num_samples = inference->dims()[0];
     size_t infer_width = inference->dims()[1];
-    cudaError_t e = cudaMemset(accuracy_data, 0, sizeof(float));
-    PADDLE_ENFORCE_EQ(0, e, "cudaMemset error");
+    PADDLE_ENFORCE(cudaMemset(accuracy_data, 0, sizeof(float)));
 
     if (num_samples == 0) {
       return;