From 71b6bdb5d4dc090f8746845bf7bba9f62415e9f3 Mon Sep 17 00:00:00 2001 From: Siddharth Goyal Date: Mon, 4 Jun 2018 13:15:05 -0700 Subject: [PATCH] Fix signed-unsigned comparison warning (#11167) --- paddle/fluid/operators/sgd_op.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paddle/fluid/operators/sgd_op.h b/paddle/fluid/operators/sgd_op.h index f9e0596191d..2685ce217ee 100644 --- a/paddle/fluid/operators/sgd_op.h +++ b/paddle/fluid/operators/sgd_op.h @@ -114,7 +114,7 @@ class SGDOpKernel : public framework::OpKernel { int64_t id_index = param.Index(grad.rows()[i]); PADDLE_ENFORCE_GE(id_index, static_cast(0), "id should be in the table"); - for (size_t j = 0; j < grad_row_width; j++) { + for (int64_t j = 0; j < grad_row_width; j++) { out_data[id_index * grad_row_width + j] -= lr[0] * grad_data[i * grad_row_width + j]; } -- GitLab