diff --git a/paddle/operators/lookup_table_op.cu b/paddle/operators/lookup_table_op.cu index 0482746ec88c23faeaf01b518489eb978c374f4f..d97390fa1c53fa0bdf16ab34cb209b994621f83c 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];