From abb97bc5a1b1d0b1689db61a930e256e0f8be1ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=98=A5=E4=B9=94?= <83450930+Liyulingyue@users.noreply.github.com> Date: Sun, 8 Dec 2024 14:15:01 +0800 Subject: [PATCH] Apply suggestions from code review --- paddlespeech/t2s/modules/tacotron2/attentions.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/paddlespeech/t2s/modules/tacotron2/attentions.py b/paddlespeech/t2s/modules/tacotron2/attentions.py index a7d3b2326..86407e778 100644 --- a/paddlespeech/t2s/modules/tacotron2/attentions.py +++ b/paddlespeech/t2s/modules/tacotron2/attentions.py @@ -171,7 +171,8 @@ class AttLoc(nn.Layer): if paddle.sum(att_prev) == 0: # if no bias, 0 0-pad goes 0 att_prev = 1.0 - make_pad_mask(enc_hs_len) - att_prev = att_prev / enc_hs_len.unsqueeze(-1).astype(att_prev.dtype) + att_prev = att_prev / enc_hs_len.unsqueeze(-1).astype( + att_prev.dtype) # att_prev: (utt, frame) -> (utt, 1, 1, frame) # -> (utt, att_conv_chans, 1, frame)