Remove unused vars in Delightful TTS layers tests

This commit is contained in:
Edresson Casanova 2023-10-23 09:26:36 -03:00
parent ec7f54768a
commit e8a1a50273
1 changed files with 3 additions and 5 deletions

View File

@ -28,7 +28,7 @@ tokenizer, config = TTSTokenizer.init_from_config(config)
def test_acoustic_model():
dummy_tokens = torch.rand((1, 41)).long().to(device)
dummy_text_lens = torch.tensor([41]).to(device)
dummy_text_lens = torch.tensor([41]).long().to(device)
dummy_spec = torch.rand((1, 100, 207)).to(device)
dummy_spec_lens = torch.tensor([207]).to(device)
dummy_pitch = torch.rand((1, 1, 207)).long().to(device)
@ -38,6 +38,7 @@ def test_acoustic_model():
args.num_mels = 100
acoustic_model = AcousticModel(args=args, tokenizer=tokenizer, speaker_manager=None).to(device)
acoustic_model = acoustic_model.train()
output = acoustic_model(
tokens=dummy_tokens,
@ -56,11 +57,7 @@ def test_acoustic_model():
def test_hifi_decoder():
dummy_input = torch.rand((1, 207, 100)).to(device)
dummy_text_lens = torch.tensor([41]).to(device)
dummy_spec = torch.rand((1, 100, 207)).to(device)
dummy_spec_lens = torch.tensor([207]).to(device)
dummy_pitch = torch.rand((1, 1, 207)).long().to(device)
dummy_energy = torch.rand((1, 1, 207)).long().to(device)
waveform_decoder = HifiganGenerator(
100,
@ -77,6 +74,7 @@ def test_hifi_decoder():
conv_post_weight_norm=False,
conv_post_bias=False,
).to(device)
waveform_decoder = waveform_decoder.train()
vocoder_input_slices, slice_ids = rand_segments( # pylint: disable=unused-variable
x=dummy_input.transpose(1, 2),