Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
4 changes: 2 additions & 2 deletions test/test.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import unittest
import test.common_utils
import common_utils
import torch
import torchaudio
import math
import os


class Test_LoadSave(unittest.TestCase):
test_dirpath, test_dir = test.common_utils.create_temp_assets_dir()
test_dirpath, test_dir = common_utils.create_temp_assets_dir()
test_filepath = os.path.join(test_dirpath, "assets",
"steam-train-whistle-daniel_simon.mp3")

Expand Down
10 changes: 5 additions & 5 deletions test/compliance/test_kaldi.py → test/test_compliance_kaldi.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import math
import os
import test.common_utils
import test.compliance.utils
import common_utils
import compliance.utils
import torch
import torchaudio
import torchaudio.compliance.kaldi as kaldi
Expand Down Expand Up @@ -45,11 +45,11 @@ def first_sample_of_frame(frame, window_size, window_shift, snip_edges):


class Test_Kaldi(unittest.TestCase):
test_dirpath, test_dir = test.common_utils.create_temp_assets_dir()
test_dirpath, test_dir = common_utils.create_temp_assets_dir()
test_filepath = os.path.join(test_dirpath, 'assets', 'kaldi_file.wav')
test_8000_filepath = os.path.join(test_dirpath, 'assets', 'kaldi_file_8000.wav')
kaldi_output_dir = os.path.join(test_dirpath, 'assets', 'kaldi')
test_filepaths = {prefix: [] for prefix in test.compliance.utils.TEST_PREFIX}
test_filepaths = {prefix: [] for prefix in compliance.utils.TEST_PREFIX}

# separating test files by their types (e.g 'spec', 'fbank', etc.)
for f in os.listdir(kaldi_output_dir):
Expand Down Expand Up @@ -151,7 +151,7 @@ def _compliance_test_helper(self, sound_filepath, filepath_key, expected_num_fil
args = f.split('-')
args[-1] = os.path.splitext(args[-1])[0]
assert len(args) == expected_num_args, 'invalid test kaldi file name'
args = [test.compliance.utils.parse(arg) for arg in args]
args = [compliance.utils.parse(arg) for arg in args]

output = get_output_fn(sound, args)

Expand Down
4 changes: 2 additions & 2 deletions test/test_dataloader.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import unittest
import test.common_utils
import common_utils
import torch
import torch.nn as nn
from torch.utils.data import Dataset, DataLoader
Expand All @@ -10,7 +10,7 @@

class TORCHAUDIODS(Dataset):

test_dirpath, test_dir = test.common_utils.create_temp_assets_dir()
test_dirpath, test_dir = common_utils.create_temp_assets_dir()

def __init__(self):
self.asset_dirpath = os.path.join(self.test_dirpath, "assets")
Expand Down
4 changes: 2 additions & 2 deletions test/datasets/test_vctk.py → test/test_datasets_vctk.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
import torch
import torchaudio
import unittest
import test.common_utils
import common_utils
import torchaudio.datasets.vctk as vctk


class TestVCTK(unittest.TestCase):
def setUp(self):
self.test_dirpath, self.test_dir = test.common_utils.create_temp_assets_dir()
self.test_dirpath, self.test_dir = common_utils.create_temp_assets_dir()

def get_full_path(self, file):
return os.path.join(self.test_dirpath, 'assets', file)
Expand Down
4 changes: 2 additions & 2 deletions test/test_functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import torchaudio.functional as F
import pytest
import unittest
import test.common_utils
import common_utils

from torchaudio.common_utils import IMPORT_LIBROSA

Expand All @@ -30,7 +30,7 @@ def _test_istft_is_inverse_of_stft(self, kwargs):
# operation to check whether we can reconstruct signal
for data_size in self.data_sizes:
for i in range(self.number_of_trials):
sound = test.common_utils.random_float_tensor(i, data_size)
sound = common_utils.random_float_tensor(i, data_size)

stft = torch.stft(sound, **kwargs)
estimate = torchaudio.functional.istft(stft, length=sound.size(1), **kwargs)
Expand Down
4 changes: 2 additions & 2 deletions test/test_kaldi_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
import torch
import torchaudio.kaldi_io as kio
import unittest
import test.common_utils
import common_utils


class Test_KaldiIO(unittest.TestCase):
data1 = [[1, 2, 3], [11, 12, 13], [21, 22, 23]]
data2 = [[31, 32, 33], [41, 42, 43], [51, 52, 53]]
test_dirpath, test_dir = test.common_utils.create_temp_assets_dir()
test_dirpath, test_dir = common_utils.create_temp_assets_dir()

def _test_helper(self, file_name, expected_data, fn, expected_dtype):
""" Takes a file_name to the input data and a function fn to extract the
Expand Down
4 changes: 2 additions & 2 deletions test/test_legacy.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import unittest
import test.common_utils
import common_utils
import torch
import torchaudio
from torchaudio.legacy import save, load
Expand All @@ -8,7 +8,7 @@


class Test_LoadSave(unittest.TestCase):
test_dirpath, test_dir = test.common_utils.create_temp_assets_dir()
test_dirpath, test_dir = common_utils.create_temp_assets_dir()
test_filepath = os.path.join(test_dirpath, "assets",
"steam-train-whistle-daniel_simon.mp3")

Expand Down
4 changes: 2 additions & 2 deletions test/test_sox_effects.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import unittest
import test.common_utils
import common_utils
import torch
import torchaudio
import math
import os


class Test_SoxEffectsChain(unittest.TestCase):
test_dirpath, test_dir = test.common_utils.create_temp_assets_dir()
test_dirpath, test_dir = common_utils.create_temp_assets_dir()
test_filepath = os.path.join(test_dirpath, "assets",
"steam-train-whistle-daniel_simon.mp3")

Expand Down
4 changes: 2 additions & 2 deletions test/test_transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from torchaudio.common_utils import IMPORT_LIBROSA, IMPORT_SCIPY
import torchaudio.transforms as transforms
import unittest
import test.common_utils
import common_utils

if IMPORT_LIBROSA:
import librosa
Expand All @@ -26,7 +26,7 @@ class Tester(unittest.TestCase):
waveform.unsqueeze_(0) # (1, 64000)
waveform = (waveform * volume * 2**31).long()
# file for stereo stft test
test_dirpath, test_dir = test.common_utils.create_temp_assets_dir()
test_dirpath, test_dir = common_utils.create_temp_assets_dir()
test_filepath = os.path.join(test_dirpath, 'assets',
'steam-train-whistle-daniel_simon.mp3')

Expand Down