未验证 提交 6cf8f24b 编写于 作者: Q Qiao Longfei 提交者: GitHub

Merge pull request #14389 from jacquesqiao/fix_sgd_op_optimize_sparse_table

sgd_op optimize selected rows do not enforce id < height
...@@ -109,8 +109,6 @@ class SGDOpKernel : public framework::OpKernel<T> { ...@@ -109,8 +109,6 @@ class SGDOpKernel : public framework::OpKernel<T> {
const auto *grad_data = grad.value().data<T>(); const auto *grad_data = grad.value().data<T>();
auto *out_data = param_out->mutable_value()->data<T>(); auto *out_data = param_out->mutable_value()->data<T>();
for (size_t i = 0; i < grad.rows().size(); i++) { for (size_t i = 0; i < grad.rows().size(); i++) {
PADDLE_ENFORCE(grad.rows()[i] < grad.height(),
"Input rows index should less than height");
int64_t id_index = param_out->AutoGrownIndex(grad.rows()[i], false); int64_t id_index = param_out->AutoGrownIndex(grad.rows()[i], false);
PADDLE_ENFORCE_GE(id_index, static_cast<int64_t>(0), PADDLE_ENFORCE_GE(id_index, static_cast<int64_t>(0),
"id should be in the table"); "id should be in the table");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册