From 47d74ced1c0cc462590a51817bbc31617ce97a30 Mon Sep 17 00:00:00 2001 From: Alexander Korolev Date: Fri, 23 Oct 2020 14:15:01 +0200 Subject: [PATCH] Update losses.py Seems like in the latest dev merge, this change was reverted. Any specific reason for this? Without it the problem as stated here https://github.com/mozilla/TTS/issues/473 occurs. --- TTS/tts/layers/losses.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TTS/tts/layers/losses.py b/TTS/tts/layers/losses.py index f07851ac..b5663ddd 100644 --- a/TTS/tts/layers/losses.py +++ b/TTS/tts/layers/losses.py @@ -169,7 +169,7 @@ class GuidedAttentionLoss(torch.nn.Module): @staticmethod def _make_ga_mask(ilen, olen, sigma): - grid_x, grid_y = torch.meshgrid(torch.arange(olen), torch.arange(ilen)) + grid_x, grid_y = torch.meshgrid(torch.arange(olen, device=olen.device), torch.arange(ilen, device=ilen.device)) grid_x, grid_y = grid_x.float(), grid_y.float() return 1.0 - torch.exp(-(grid_y / ilen - grid_x / olen)**2 / (2 * (sigma**2))) @@ -306,4 +306,4 @@ class GlowTTSLoss(torch.nn.Module): return_dict['loss'] = log_mle + loss_dur return_dict['log_mle'] = log_mle return_dict['loss_dur'] = loss_dur - return return_dict \ No newline at end of file + return return_dict