Skip to content

Commit 51f3838

Browse files
committed
add log for not exist code
test=develop
1 parent 7aa8b2c commit 51f3838

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

paddle/fluid/framework/selected_rows.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,10 @@ void SelectedRows::Get(const framework::Tensor& ids, framework::Tensor* value,
213213
"output tensor should have the same shape with table "
214214
"except the dims[0].");
215215
for (int i = 0; i < ids.numel(); ++i) {
216-
int64_t index =
217-
AutoGrownIndex(ids.data<int64_t>()[i], auto_grown, is_test);
216+
auto id = ids.data<int64_t>()[i];
217+
int64_t index = AutoGrownIndex(id, auto_grown, is_test);
218218
if (index < 0) {
219+
VLOG(5) << "id " << id << " not in the table, return 0";
219220
framework::VisitDataType(
220221
framework::ToDataType(value_->type()),
221222
TensorFillVisitor(value, i * value_width, value_width, 0.0));

0 commit comments

Comments
 (0)