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

pull/1340/head
TianYuan 3 years ago committed by GitHub
parent 2170a5cb1d
commit a1867c20c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -30,7 +30,9 @@ def expand(encodings: paddle.Tensor, durations: paddle.Tensor) -> paddle.Tensor:
k = 0
for j in range(t_enc):
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
encodings = paddle.matmul(M, encodings)
return encodings

Loading…
Cancel
Save