From be4a9853a1041992982a151c1738de81d02545ce Mon Sep 17 00:00:00 2001 From: cschaefer26 Date: Mon, 6 Jul 2020 09:50:25 +0200 Subject: [PATCH] Reverted to standard cumsum for LR. --- models/forward_tacotron.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/models/forward_tacotron.py b/models/forward_tacotron.py index 1c95d45..516a24d 100644 --- a/models/forward_tacotron.py +++ b/models/forward_tacotron.py @@ -18,12 +18,10 @@ def __init__(self): def forward(self, x, dur): return self.expand(x, dur) - def build_index(self, duration, x): + @staticmethod + def build_index(duration, x): duration[duration < 0] = 0 - tot_duration = duration.cumsum(1).detach().cpu().numpy() - if not self.training: - tot_duration = tot_duration + 0.5 - tot_duration = tot_duration.astype('int') + tot_duration = duration.cumsum(1).detach().cpu().numpy().astype('int') max_duration = int(tot_duration.max().item()) index = np.zeros([x.shape[0], max_duration, x.shape[2]], dtype='long')