From 5fee7182425a3e7af3c6e3bdcb4193acc9138429 Mon Sep 17 00:00:00 2001 From: Meiyim Date: Wed, 6 Nov 2019 17:48:14 +0800 Subject: [PATCH] fix icafe issue: DLTP-3138 (sequence_unpad compatibility) (#3892) --- PaddleNLP/preprocess/padding.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PaddleNLP/preprocess/padding.py b/PaddleNLP/preprocess/padding.py index 6094562d..82171e68 100644 --- a/PaddleNLP/preprocess/padding.py +++ b/PaddleNLP/preprocess/padding.py @@ -69,7 +69,7 @@ def pad_batch_data(insts, if return_seq_lens: seq_lens = np.array([len(inst) for inst in insts]) - return_list += [seq_lens.astype("int64").reshape([-1, 1])] + return_list += [seq_lens.astype("int64").reshape([-1])] return return_list if len(return_list) > 1 else return_list[0] -- GitLab