From c09c9883b65111048d191a43593002e6f6c08749 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: Thu, 5 Dec 2024 22:28:45 +0800 Subject: [PATCH] Apply suggestions from code review --- paddlespeech/t2s/modules/tacotron2/attentions.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/paddlespeech/t2s/modules/tacotron2/attentions.py b/paddlespeech/t2s/modules/tacotron2/attentions.py index 1676fc330..a7d3b2326 100644 --- a/paddlespeech/t2s/modules/tacotron2/attentions.py +++ b/paddlespeech/t2s/modules/tacotron2/attentions.py @@ -171,9 +171,7 @@ 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) - unsqueeze_enc_hs_len = enc_hs_len.unsqueeze(-1).astype( - att_prev.dtype) - att_prev = att_prev / unsqueeze_enc_hs_len + 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)