From 7d3b2e4b03d1ec3387e766b2821e24532ea95afd Mon Sep 17 00:00:00 2001 From: Yibing Liu Date: Wed, 17 Jan 2018 00:06:00 -0800 Subject: [PATCH] Fix a bug in sequence_erase_op --- paddle/operators/sequence_erase_op.cu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paddle/operators/sequence_erase_op.cu b/paddle/operators/sequence_erase_op.cu index 5da8eba3e1a..daf5b29863c 100644 --- a/paddle/operators/sequence_erase_op.cu +++ b/paddle/operators/sequence_erase_op.cu @@ -55,7 +55,7 @@ __global__ void SetOutput(const T* in_dat, const int in_len, const int* num_erased, T* out_dat) { int index = blockIdx.x * blockDim.x + threadIdx.x; if (index < in_len) { - if (in_dat[index] != in_dat[index + 1]) { + if (num_erased[index] == num_erased[index + 1]) { out_dat[index - num_erased[index]] = in_dat[index]; } } -- GitLab