diff --git a/paddle/fluid/framework/selected_rows.cc b/paddle/fluid/framework/selected_rows.cc index c41b95193e21e7c16b80623f0290e7ff737bb22e..f4f2b769d5e47d8fba8d08476df4cd8e54133551 100644 --- a/paddle/fluid/framework/selected_rows.cc +++ b/paddle/fluid/framework/selected_rows.cc @@ -213,9 +213,10 @@ void SelectedRows::Get(const framework::Tensor& ids, framework::Tensor* value, "output tensor should have the same shape with table " "except the dims[0]."); for (int i = 0; i < ids.numel(); ++i) { - int64_t index = - AutoGrownIndex(ids.data()[i], auto_grown, is_test); + auto id = ids.data()[i]; + int64_t index = AutoGrownIndex(id, auto_grown, is_test); if (index < 0) { + VLOG(5) << "id " << id << " not in the table, return 0"; framework::VisitDataType( framework::ToDataType(value_->type()), TensorFillVisitor(value, i * value_width, value_width, 0.0));