revise loader-tests disabled zero frame

This commit is contained in:
Eren Golge 2019-12-09 12:07:51 +01:00
parent e89d62a772
commit 94d1c93790
1 changed files with 9 additions and 9 deletions

View File

@ -138,8 +138,8 @@ class TestTTSDataset(unittest.TestCase):
# there is a slight difference between two matrices. # there is a slight difference between two matrices.
# TODO: Check this assert cond more in detail. # TODO: Check this assert cond more in detail.
assert abs((abs(mel.T) assert abs((abs(mel.T)
- abs(mel_dl[:-1]) - abs(mel_dl)
).sum()) < 1e-5, (abs(mel.T) - abs(mel_dl[:-1])).sum() ).sum()) < 1e-5, (abs(mel.T) - abs(mel_dl)).sum()
# check mel-spec correctness # check mel-spec correctness
mel_spec = mel_input[0].cpu().numpy() mel_spec = mel_input[0].cpu().numpy()
@ -155,9 +155,9 @@ class TestTTSDataset(unittest.TestCase):
OUTPATH + '/linear_target_dataloader.wav') OUTPATH + '/linear_target_dataloader.wav')
# check the last time step to be zero padded # check the last time step to be zero padded
assert linear_input[0, -1].sum() == 0 assert linear_input[0, -1].sum() != 0
assert linear_input[0, -2].sum() != 0 assert linear_input[0, -2].sum() != 0
assert mel_input[0, -1].sum() == 0 assert mel_input[0, -1].sum() != 0
assert mel_input[0, -2].sum() != 0 assert mel_input[0, -2].sum() != 0
assert stop_target[0, -1] == 1 assert stop_target[0, -1] == 1
assert stop_target[0, -2] == 0 assert stop_target[0, -2] == 0
@ -187,9 +187,9 @@ class TestTTSDataset(unittest.TestCase):
idx = 1 idx = 1
# check the first item in the batch # check the first item in the batch
assert linear_input[idx, -1].sum() == 0 assert linear_input[idx, -1].sum() != 0
assert linear_input[idx, -2].sum() != 0, linear_input assert linear_input[idx, -2].sum() != 0, linear_input
assert mel_input[idx, -1].sum() == 0 assert mel_input[idx, -1].sum() != 0
assert mel_input[idx, -2].sum() != 0, mel_input assert mel_input[idx, -2].sum() != 0, mel_input
assert stop_target[idx, -1] == 1 assert stop_target[idx, -1] == 1
assert stop_target[idx, -2] == 0 assert stop_target[idx, -2] == 0
@ -204,6 +204,6 @@ class TestTTSDataset(unittest.TestCase):
assert stop_target[1 - idx, -1] == 1 assert stop_target[1 - idx, -1] == 1
assert len(mel_lengths.shape) == 1 assert len(mel_lengths.shape) == 1
# check batch conditions # check batch zero-frame conditions (zero-frame disabled)
assert (linear_input * stop_target.unsqueeze(2)).sum() == 0 # assert (linear_input * stop_target.unsqueeze(2)).sum() == 0
assert (mel_input * stop_target.unsqueeze(2)).sum() == 0 # assert (mel_input * stop_target.unsqueeze(2)).sum() == 0