Unverified Commit 749c0e39 authored by Jcaw's avatar Jcaw Committed by GitHub
Browse files

Remove VAD from batch consistency tests (#1451)

The VAD function trims the input tensor to the first instance of voice
activity on any channel or item. Trimming batches this way may be
undesirable as the item with earliest activity will dominate. Either
way, the batch behaviour does not match the itemwise behaviour.

The VAD batch consistency tests currently pass out of coincidence, but
they specify incorrect behaviour. This commit removes them.
parent 78c3480e
...@@ -197,22 +197,6 @@ class TestFunctional(common_utils.TorchaudioTestCase): ...@@ -197,22 +197,6 @@ class TestFunctional(common_utils.TorchaudioTestCase):
F.sliding_window_cmn, spectrogram, center=center, F.sliding_window_cmn, spectrogram, center=center,
norm_vars=norm_vars) norm_vars=norm_vars)
def test_vad_from_file(self):
filepath = common_utils.get_asset_path("vad-go-stereo-44100.wav")
waveform, sample_rate = common_utils.load_wav(filepath)
# Each channel is slightly offset - we can use this to create a batch
# with different items.
batch = waveform.view(2, 1, -1)
self.assert_batch_consistency(F.vad, batch, sample_rate=sample_rate)
def test_vad_different_items(self):
"""Separate test to ensure VAD consistency with differing items."""
sample_rate = 44100
torch.manual_seed(0)
waveforms = torch.rand(self.batch_size, 2, 100) - 0.5
self.assert_batch_consistency(
F.vad, waveforms, sample_rate=sample_rate)
@common_utils.skipIfNoKaldi @common_utils.skipIfNoKaldi
def test_compute_kaldi_pitch(self): def test_compute_kaldi_pitch(self):
sample_rate = 44100 sample_rate = 44100
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment