提交 b874d846 编写于 作者: H Hui Zhang 提交者: 小湉湉

Merge pull request #791 from Jackwaterveg/fix_bug

Fix bug of paddling len for "def forward_chunk_by_chunk"
......@@ -180,8 +180,10 @@ class CRNNEncoder(nn.Layer):
eouts_chunk_list = []
eouts_chunk_lens_list = []
padding_len = chunk_stride - (max_len - chunk_size) % chunk_stride
if (max_len - chunk_size) % chunk_stride != 0:
padding_len = chunk_stride - (max_len - chunk_size) % chunk_stride
else:
padding_len = 0
padding = paddle.zeros((x.shape[0], padding_len, x.shape[2]))
padded_x = paddle.concat([x, padding], axis=1)
num_chunk = (max_len + padding_len - chunk_size) / chunk_stride + 1
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册