未验证 提交 a1867c20 编写于 作者: 小湉湉's avatar 小湉湉 提交者: GitHub

fix slice bug of speedyspeech expand, test=tts (#1337)

上级 2170a5cb
...@@ -30,7 +30,9 @@ def expand(encodings: paddle.Tensor, durations: paddle.Tensor) -> paddle.Tensor: ...@@ -30,7 +30,9 @@ def expand(encodings: paddle.Tensor, durations: paddle.Tensor) -> paddle.Tensor:
k = 0 k = 0
for j in range(t_enc): for j in range(t_enc):
d = durations[i, j] d = durations[i, j]
M[i, k:k + d, j] = 1 # If the d == 0, slice action is meaningless and not supported
if d >= 1:
M[0, k:k + d, j] = 1
k += d k += d
encodings = paddle.matmul(M, encodings) encodings = paddle.matmul(M, encodings)
return encodings return encodings
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册