Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
Torchaudio
Commits
a59e9ab8
Unverified
Commit
a59e9ab8
authored
Nov 09, 2023
by
moto
Committed by
GitHub
Nov 09, 2023
Browse files
Remove global audio backend from test (#3691)
global audio backend is removed thus this is no-op.
parent
4c85f817
Changes
28
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
3 additions
and
59 deletions
+3
-59
test/torchaudio_unittest/common_utils/__init__.py
test/torchaudio_unittest/common_utils/__init__.py
+0
-2
test/torchaudio_unittest/common_utils/backend_utils.py
test/torchaudio_unittest/common_utils/backend_utils.py
+0
-21
test/torchaudio_unittest/common_utils/case_utils.py
test/torchaudio_unittest/common_utils/case_utils.py
+1
-5
test/torchaudio_unittest/datasets/cmuarctic_test.py
test/torchaudio_unittest/datasets/cmuarctic_test.py
+0
-1
test/torchaudio_unittest/datasets/commonvoice_test.py
test/torchaudio_unittest/datasets/commonvoice_test.py
+0
-2
test/torchaudio_unittest/datasets/dr_vctk_test.py
test/torchaudio_unittest/datasets/dr_vctk_test.py
+0
-1
test/torchaudio_unittest/datasets/fluentcommands_test.py
test/torchaudio_unittest/datasets/fluentcommands_test.py
+0
-1
test/torchaudio_unittest/datasets/gtzan_test.py
test/torchaudio_unittest/datasets/gtzan_test.py
+0
-1
test/torchaudio_unittest/datasets/iemocap_test.py
test/torchaudio_unittest/datasets/iemocap_test.py
+0
-1
test/torchaudio_unittest/datasets/librilightlimited_test.py
test/torchaudio_unittest/datasets/librilightlimited_test.py
+0
-1
test/torchaudio_unittest/datasets/librimix_test.py
test/torchaudio_unittest/datasets/librimix_test.py
+0
-1
test/torchaudio_unittest/datasets/librispeech_test_impl.py
test/torchaudio_unittest/datasets/librispeech_test_impl.py
+0
-1
test/torchaudio_unittest/datasets/libritts_test.py
test/torchaudio_unittest/datasets/libritts_test.py
+0
-1
test/torchaudio_unittest/datasets/ljspeech_test.py
test/torchaudio_unittest/datasets/ljspeech_test.py
+0
-1
test/torchaudio_unittest/datasets/musdb_hq_test.py
test/torchaudio_unittest/datasets/musdb_hq_test.py
+0
-1
test/torchaudio_unittest/datasets/quesst14_test.py
test/torchaudio_unittest/datasets/quesst14_test.py
+0
-1
test/torchaudio_unittest/datasets/snips_test.py
test/torchaudio_unittest/datasets/snips_test.py
+0
-1
test/torchaudio_unittest/datasets/speechcommands_test.py
test/torchaudio_unittest/datasets/speechcommands_test.py
+0
-1
test/torchaudio_unittest/datasets/tedlium_test.py
test/torchaudio_unittest/datasets/tedlium_test.py
+2
-14
test/torchaudio_unittest/datasets/vctk_test.py
test/torchaudio_unittest/datasets/vctk_test.py
+0
-1
No files found.
test/torchaudio_unittest/common_utils/__init__.py
View file @
a59e9ab8
from
.autograd_utils
import
use_deterministic_algorithms
from
.autograd_utils
import
use_deterministic_algorithms
from
.backend_utils
import
set_audio_backend
from
.case_utils
import
(
from
.case_utils
import
(
disabledInCI
,
disabledInCI
,
HttpServerMixin
,
HttpServerMixin
,
...
@@ -37,7 +36,6 @@ __all__ = [
...
@@ -37,7 +36,6 @@ __all__ = [
"get_whitenoise"
,
"get_whitenoise"
,
"get_sinusoid"
,
"get_sinusoid"
,
"get_spectrogram"
,
"get_spectrogram"
,
"set_audio_backend"
,
"TempDirMixin"
,
"TempDirMixin"
,
"HttpServerMixin"
,
"HttpServerMixin"
,
"TestBaseMixin"
,
"TestBaseMixin"
,
...
...
test/torchaudio_unittest/common_utils/backend_utils.py
deleted
100644 → 0
View file @
4c85f817
import
unittest
import
torchaudio
def
set_audio_backend
(
backend
):
"""Allow additional backend value, 'default'"""
backends
=
torchaudio
.
list_audio_backends
()
if
backend
==
"soundfile"
:
be
=
"soundfile"
elif
backend
==
"default"
:
if
"sox_io"
in
backends
:
be
=
"sox_io"
elif
"soundfile"
in
backends
:
be
=
"soundfile"
else
:
raise
unittest
.
SkipTest
(
"No default backend available"
)
else
:
be
=
backend
torchaudio
.
set_audio_backend
(
be
)
test/torchaudio_unittest/common_utils/case_utils.py
View file @
a59e9ab8
...
@@ -15,8 +15,6 @@ from torch.testing._internal.common_utils import TestCase as PytorchTestCase
...
@@ -15,8 +15,6 @@ from torch.testing._internal.common_utils import TestCase as PytorchTestCase
from
torchaudio._internal.module_utils
import
eval_env
,
is_module_available
from
torchaudio._internal.module_utils
import
eval_env
,
is_module_available
from
torchaudio.utils.ffmpeg_utils
import
get_video_decoders
,
get_video_encoders
from
torchaudio.utils.ffmpeg_utils
import
get_video_decoders
,
get_video_encoders
from
.backend_utils
import
set_audio_backend
class
TempDirMixin
:
class
TempDirMixin
:
"""Mixin to provide easy access to temp dir"""
"""Mixin to provide easy access to temp dir"""
...
@@ -88,15 +86,13 @@ class HttpServerMixin(TempDirMixin):
...
@@ -88,15 +86,13 @@ class HttpServerMixin(TempDirMixin):
class
TestBaseMixin
:
class
TestBaseMixin
:
"""Mixin to provide consistent way to define device/dtype
/backend
aware TestCase"""
"""Mixin to provide consistent way to define device/dtype aware TestCase"""
dtype
=
None
dtype
=
None
device
=
None
device
=
None
backend
=
None
def
setUp
(
self
):
def
setUp
(
self
):
super
().
setUp
()
super
().
setUp
()
set_audio_backend
(
self
.
backend
)
torch
.
random
.
manual_seed
(
2434
)
torch
.
random
.
manual_seed
(
2434
)
@
property
@
property
...
...
test/torchaudio_unittest/datasets/cmuarctic_test.py
View file @
a59e9ab8
...
@@ -47,7 +47,6 @@ def get_mock_dataset(root_dir):
...
@@ -47,7 +47,6 @@ def get_mock_dataset(root_dir):
class
TestCMUARCTIC
(
TempDirMixin
,
TorchaudioTestCase
):
class
TestCMUARCTIC
(
TempDirMixin
,
TorchaudioTestCase
):
backend
=
"default"
root_dir
=
None
root_dir
=
None
samples
=
[]
samples
=
[]
...
...
test/torchaudio_unittest/datasets/commonvoice_test.py
View file @
a59e9ab8
...
@@ -142,7 +142,6 @@ class BaseTestCommonVoice(TempDirMixin):
...
@@ -142,7 +142,6 @@ class BaseTestCommonVoice(TempDirMixin):
class
TestCommonVoiceEN
(
BaseTestCommonVoice
,
TorchaudioTestCase
):
class
TestCommonVoiceEN
(
BaseTestCommonVoice
,
TorchaudioTestCase
):
backend
=
"default"
root_dir
=
None
root_dir
=
None
@
classmethod
@
classmethod
...
@@ -160,7 +159,6 @@ class TestCommonVoiceEN(BaseTestCommonVoice, TorchaudioTestCase):
...
@@ -160,7 +159,6 @@ class TestCommonVoiceEN(BaseTestCommonVoice, TorchaudioTestCase):
class
TestCommonVoiceFR
(
BaseTestCommonVoice
,
TorchaudioTestCase
):
class
TestCommonVoiceFR
(
BaseTestCommonVoice
,
TorchaudioTestCase
):
backend
=
"default"
root_dir
=
None
root_dir
=
None
@
classmethod
@
classmethod
...
...
test/torchaudio_unittest/datasets/dr_vctk_test.py
View file @
a59e9ab8
...
@@ -74,7 +74,6 @@ def get_mock_dataset(root_dir):
...
@@ -74,7 +74,6 @@ def get_mock_dataset(root_dir):
class
TestDRVCTK
(
TempDirMixin
,
TorchaudioTestCase
):
class
TestDRVCTK
(
TempDirMixin
,
TorchaudioTestCase
):
backend
=
"default"
root_dir
=
None
root_dir
=
None
samples
=
{}
samples
=
{}
...
...
test/torchaudio_unittest/datasets/fluentcommands_test.py
View file @
a59e9ab8
...
@@ -104,7 +104,6 @@ def get_mock_dataset(dataset_dir: str):
...
@@ -104,7 +104,6 @@ def get_mock_dataset(dataset_dir: str):
class
TestFluentSpeechCommands
(
TempDirMixin
,
TorchaudioTestCase
):
class
TestFluentSpeechCommands
(
TempDirMixin
,
TorchaudioTestCase
):
root_dir
=
None
root_dir
=
None
backend
=
"default"
mocked_train_samples
=
[]
mocked_train_samples
=
[]
mocked_valid_samples
=
[]
mocked_valid_samples
=
[]
...
...
test/torchaudio_unittest/datasets/gtzan_test.py
View file @
a59e9ab8
...
@@ -37,7 +37,6 @@ def get_mock_dataset(root_dir):
...
@@ -37,7 +37,6 @@ def get_mock_dataset(root_dir):
class
TestGTZAN
(
TempDirMixin
,
TorchaudioTestCase
):
class
TestGTZAN
(
TempDirMixin
,
TorchaudioTestCase
):
backend
=
"default"
root_dir
=
None
root_dir
=
None
samples
=
[]
samples
=
[]
...
...
test/torchaudio_unittest/datasets/iemocap_test.py
View file @
a59e9ab8
...
@@ -91,7 +91,6 @@ def get_mock_dataset(dataset_dir: str):
...
@@ -91,7 +91,6 @@ def get_mock_dataset(dataset_dir: str):
class
TestIemocap
(
TempDirMixin
,
TorchaudioTestCase
):
class
TestIemocap
(
TempDirMixin
,
TorchaudioTestCase
):
root_dir
=
None
root_dir
=
None
backend
=
"default"
all_samples
=
[]
all_samples
=
[]
script_samples
=
[]
script_samples
=
[]
...
...
test/torchaudio_unittest/datasets/librilightlimited_test.py
View file @
a59e9ab8
...
@@ -69,7 +69,6 @@ def get_mock_datasets(root_dir):
...
@@ -69,7 +69,6 @@ def get_mock_datasets(root_dir):
class
TestLibriLightLimited
(
TempDirMixin
,
TorchaudioTestCase
):
class
TestLibriLightLimited
(
TempDirMixin
,
TorchaudioTestCase
):
backend
=
"default"
root_dir
=
None
root_dir
=
None
samples_10min
=
[]
samples_10min
=
[]
...
...
test/torchaudio_unittest/datasets/librimix_test.py
View file @
a59e9ab8
...
@@ -65,7 +65,6 @@ def get_mock_dataset(root_dir: str, num_speaker: int):
...
@@ -65,7 +65,6 @@ def get_mock_dataset(root_dir: str, num_speaker: int):
class
TestLibriMix
(
TempDirMixin
,
TorchaudioTestCase
):
class
TestLibriMix
(
TempDirMixin
,
TorchaudioTestCase
):
backend
=
"default"
root_dir
=
None
root_dir
=
None
samples_2spk
=
[]
samples_2spk
=
[]
...
...
test/torchaudio_unittest/datasets/librispeech_test_impl.py
View file @
a59e9ab8
...
@@ -49,7 +49,6 @@ def get_mock_dataset(root_dir):
...
@@ -49,7 +49,6 @@ def get_mock_dataset(root_dir):
class
LibriSpeechTestMixin
(
TempDirMixin
):
class
LibriSpeechTestMixin
(
TempDirMixin
):
backend
=
"default"
root_dir
=
None
root_dir
=
None
samples
=
[]
samples
=
[]
...
...
test/torchaudio_unittest/datasets/libritts_test.py
View file @
a59e9ab8
...
@@ -41,7 +41,6 @@ def get_mock_dataset(root_dir):
...
@@ -41,7 +41,6 @@ def get_mock_dataset(root_dir):
class
TestLibriTTS
(
TempDirMixin
,
TorchaudioTestCase
):
class
TestLibriTTS
(
TempDirMixin
,
TorchaudioTestCase
):
backend
=
"default"
root_dir
=
None
root_dir
=
None
data
=
[]
data
=
[]
...
...
test/torchaudio_unittest/datasets/ljspeech_test.py
View file @
a59e9ab8
...
@@ -45,7 +45,6 @@ def get_mock_dataset(root_dir):
...
@@ -45,7 +45,6 @@ def get_mock_dataset(root_dir):
class
TestLJSpeech
(
TempDirMixin
,
TorchaudioTestCase
):
class
TestLJSpeech
(
TempDirMixin
,
TorchaudioTestCase
):
backend
=
"default"
root_dir
=
None
root_dir
=
None
data
,
_transcripts
,
_normalized_transcript
=
[],
[],
[]
data
,
_transcripts
,
_normalized_transcript
=
[],
[],
[]
...
...
test/torchaudio_unittest/datasets/musdb_hq_test.py
View file @
a59e9ab8
...
@@ -86,7 +86,6 @@ def get_mock_dataset(dataset_dir):
...
@@ -86,7 +86,6 @@ def get_mock_dataset(dataset_dir):
class
TestMusDB_HQ
(
TempDirMixin
,
TorchaudioTestCase
):
class
TestMusDB_HQ
(
TempDirMixin
,
TorchaudioTestCase
):
root_dir
=
None
root_dir
=
None
backend
=
"default"
train_all_samples
=
{}
train_all_samples
=
{}
train_only_samples
=
{}
train_only_samples
=
{}
...
...
test/torchaudio_unittest/datasets/quesst14_test.py
View file @
a59e9ab8
...
@@ -104,7 +104,6 @@ def get_mock_dataset(dataset_dir):
...
@@ -104,7 +104,6 @@ def get_mock_dataset(dataset_dir):
class
TestQuesst14
(
TempDirMixin
,
TorchaudioTestCase
):
class
TestQuesst14
(
TempDirMixin
,
TorchaudioTestCase
):
root_dir
=
None
root_dir
=
None
backend
=
"default"
utterances
=
{}
utterances
=
{}
dev_samples
=
{}
dev_samples
=
{}
...
...
test/torchaudio_unittest/datasets/snips_test.py
View file @
a59e9ab8
...
@@ -82,7 +82,6 @@ def get_mock_datasets(dataset_dir):
...
@@ -82,7 +82,6 @@ def get_mock_datasets(dataset_dir):
class
TestSnips
(
TempDirMixin
,
TorchaudioTestCase
):
class
TestSnips
(
TempDirMixin
,
TorchaudioTestCase
):
root_dir
=
None
root_dir
=
None
backend
=
"default"
train_samples
=
{}
train_samples
=
{}
valid_samples
=
{}
valid_samples
=
{}
...
...
test/torchaudio_unittest/datasets/speechcommands_test.py
View file @
a59e9ab8
...
@@ -95,7 +95,6 @@ def get_mock_dataset(dataset_dir):
...
@@ -95,7 +95,6 @@ def get_mock_dataset(dataset_dir):
class
TestSpeechCommands
(
TempDirMixin
,
TorchaudioTestCase
):
class
TestSpeechCommands
(
TempDirMixin
,
TorchaudioTestCase
):
backend
=
"default"
root_dir
=
None
root_dir
=
None
samples
=
[]
samples
=
[]
...
...
test/torchaudio_unittest/datasets/tedlium_test.py
View file @
a59e9ab8
import
os
import
os
import
platform
from
pathlib
import
Path
from
pathlib
import
Path
from
torchaudio.datasets
import
tedlium
from
torchaudio.datasets
import
tedlium
from
torchaudio_unittest.common_utils
import
get_whitenoise
,
save_wav
,
skipIfNoSox
,
TempDirMixin
,
TorchaudioTestCase
from
torchaudio_unittest.common_utils
import
get_whitenoise
,
save_wav
,
TempDirMixin
,
TorchaudioTestCase
# Used to generate a unique utterance for each dummy audio file
# Used to generate a unique utterance for each dummy audio file
_UTTERANCES
=
[
_UTTERANCES
=
[
...
@@ -84,7 +83,7 @@ def get_mock_dataset(dataset_dir):
...
@@ -84,7 +83,7 @@ def get_mock_dataset(dataset_dir):
return
mocked_samples
return
mocked_samples
class
Tedlium
(
TempDirMixin
):
class
Tedlium
(
TempDirMixin
,
TorchaudioTestCase
):
root_dir
=
None
root_dir
=
None
samples
=
{}
samples
=
{}
...
@@ -131,14 +130,3 @@ class Tedlium(TempDirMixin):
...
@@ -131,14 +130,3 @@ class Tedlium(TempDirMixin):
release
=
"release3"
release
=
"release3"
dataset
=
tedlium
.
TEDLIUM
(
self
.
root_dir
,
release
=
release
)
dataset
=
tedlium
.
TEDLIUM
(
self
.
root_dir
,
release
=
release
)
self
.
_test_tedlium
(
dataset
,
release
)
self
.
_test_tedlium
(
dataset
,
release
)
class
TestTedliumSoundfile
(
Tedlium
,
TorchaudioTestCase
):
backend
=
"soundfile"
if
platform
.
system
()
!=
"Windows"
:
@
skipIfNoSox
class
TestTedliumSoxIO
(
Tedlium
,
TorchaudioTestCase
):
backend
=
"sox_io"
test/torchaudio_unittest/datasets/vctk_test.py
View file @
a59e9ab8
...
@@ -57,7 +57,6 @@ def get_mock_dataset(root_dir):
...
@@ -57,7 +57,6 @@ def get_mock_dataset(root_dir):
class
TestVCTK
(
TempDirMixin
,
TorchaudioTestCase
):
class
TestVCTK
(
TempDirMixin
,
TorchaudioTestCase
):
backend
=
"default"
root_dir
=
None
root_dir
=
None
samples
=
[]
samples
=
[]
...
...
Prev
1
2
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment