From 048bc12d609686295d6a657de4162a62e7bce310 Mon Sep 17 00:00:00 2001 From: guosheng Date: Mon, 22 Jan 2018 16:31:04 +0800 Subject: [PATCH] Fix GPU kernel of lookup_table_op enhancement --- paddle/operators/lookup_table_op.cu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paddle/operators/lookup_table_op.cu b/paddle/operators/lookup_table_op.cu index 0482746ec88..d97390fa1c5 100644 --- a/paddle/operators/lookup_table_op.cu +++ b/paddle/operators/lookup_table_op.cu @@ -37,7 +37,7 @@ __global__ void LookupTable(T* output, const T* table, const int64_t* ids, const T* tab = table + id * D; for (int i = idx; i < D; i += BlockDimX) { if (PaddingFlag) { - if (idx == padding_idx) + if (id == padding_idx) out[i] = static_cast(0); else out[i] = tab[i]; -- GitLab