From 2a394f4aaa53cf381a230a059d76366710f3d6b3 Mon Sep 17 00:00:00 2001 From: Raul Puri Date: Fri, 4 May 2018 11:11:14 -0700 Subject: [PATCH 1/2] integer maxlen for padding --- model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model.py b/model.py index 1f9e7d1..7356b19 100644 --- a/model.py +++ b/model.py @@ -471,7 +471,7 @@ class Tacotron2(nn.Module): output_lengths = batch text_padded = to_gpu(text_padded).long() input_lengths = to_gpu(input_lengths).long() - max_len = torch.max(input_lengths.data) + max_len = torch.max(input_lengths.data).cpu().numpy()[0] mel_padded = to_gpu(mel_padded).float() gate_padded = to_gpu(gate_padded).float() output_lengths = to_gpu(output_lengths).long() From b20765a3dc8f7dc9f1e5427a2cccc4cb21456930 Mon Sep 17 00:00:00 2001 From: Raul Puri Date: Fri, 4 May 2018 12:12:08 -0700 Subject: [PATCH 2/2] 0.4 scalar tensor padding update --- model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model.py b/model.py index 7356b19..d416945 100644 --- a/model.py +++ b/model.py @@ -470,8 +470,8 @@ class Tacotron2(nn.Module): text_padded, input_lengths, mel_padded, gate_padded, \ output_lengths = batch text_padded = to_gpu(text_padded).long() + max_len = int(torch.max(input_lengths.data).numpy()) input_lengths = to_gpu(input_lengths).long() - max_len = torch.max(input_lengths.data).cpu().numpy()[0] mel_padded = to_gpu(mel_padded).float() gate_padded = to_gpu(gate_padded).float() output_lengths = to_gpu(output_lengths).long()