From 51f3838f969ab54f4e40a8ba22683d3a67a69be2 Mon Sep 17 00:00:00 2001 From: Qiao Longfei Date: Tue, 13 Nov 2018 16:45:41 +0800 Subject: [PATCH] add log for not exist code test=develop --- paddle/fluid/framework/selected_rows.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/paddle/fluid/framework/selected_rows.cc b/paddle/fluid/framework/selected_rows.cc index c41b95193..f4f2b769d 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)); -- GitLab