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
da59f597
Unverified
Commit
da59f597
authored
May 27, 2020
by
moto
Committed by
GitHub
May 27, 2020
Browse files
Apply tweaks required for running test in fbcode (#663)
parent
d3c83eaa
Changes
18
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
41 additions
and
28 deletions
+41
-28
test/__init__.py
test/__init__.py
+10
-0
test/kaldi_compatibility_cpu_test.py
test/kaldi_compatibility_cpu_test.py
+2
-2
test/kaldi_compatibility_cuda_test.py
test/kaldi_compatibility_cuda_test.py
+2
-2
test/kaldi_compatibility_impl.py
test/kaldi_compatibility_impl.py
+1
-1
test/test_batch_consistency.py
test/test_batch_consistency.py
+1
-1
test/test_compliance_kaldi.py
test/test_compliance_kaldi.py
+5
-5
test/test_dataloader.py
test/test_dataloader.py
+2
-2
test/test_datasets.py
test/test_datasets.py
+1
-1
test/test_functional.py
test/test_functional.py
+1
-1
test/test_io.py
test/test_io.py
+1
-1
test/test_kaldi_io.py
test/test_kaldi_io.py
+1
-1
test/test_librosa_compatibility.py
test/test_librosa_compatibility.py
+4
-1
test/test_sox_compatibility.py
test/test_sox_compatibility.py
+2
-2
test/test_sox_effects.py
test/test_sox_effects.py
+2
-2
test/test_transforms.py
test/test_transforms.py
+1
-1
test/torchscript_consistency_cpu_test.py
test/torchscript_consistency_cpu_test.py
+2
-2
test/torchscript_consistency_cuda_test.py
test/torchscript_consistency_cuda_test.py
+2
-2
test/torchscript_consistency_impl.py
test/torchscript_consistency_impl.py
+1
-1
No files found.
test/__init__.py
0 → 100644
View file @
da59f597
def
_init_fb_ctypes
():
# Initiaization required only in facebook infrastructure to use soundfile
import
libfb.py.ctypesmonkeypatch
libfb
.
py
.
ctypesmonkeypatch
.
install
()
try
:
_init_fb_ctypes
()
except
Exception
:
pass
test/kaldi_compatibility_cpu_test.py
View file @
da59f597
import
common_utils
from
kaldi_compatibility_impl
import
Kaldi
from
.
import
common_utils
from
.
kaldi_compatibility_impl
import
Kaldi
common_utils
.
define_test_suites
(
globals
(),
[
Kaldi
],
devices
=
[
'cpu'
])
test/kaldi_compatibility_cuda_test.py
View file @
da59f597
import
common_utils
from
kaldi_compatibility_impl
import
Kaldi
from
.
import
common_utils
from
.
kaldi_compatibility_impl
import
Kaldi
common_utils
.
define_test_suites
(
globals
(),
[
Kaldi
],
devices
=
[
'cuda'
])
test/kaldi_compatibility_impl.py
View file @
da59f597
...
...
@@ -8,7 +8,7 @@ import torch
import
torchaudio.functional
as
F
import
torchaudio.compliance.kaldi
import
common_utils
from
.
import
common_utils
def
_not_available
(
cmd
):
...
...
test/test_batch_consistency.py
View file @
da59f597
...
...
@@ -6,7 +6,7 @@ from torch.testing._internal.common_utils import TestCase
import
torchaudio
import
torchaudio.functional
as
F
import
common_utils
from
.
import
common_utils
class
TestFunctional
(
TestCase
):
...
...
test/test_compliance_kaldi.py
View file @
da59f597
import
math
import
os
import
compliance.utils
import
torch
import
torchaudio
import
torchaudio.compliance.kaldi
as
kaldi
import
unittest
import
common_utils
from
common_utils
import
AudioBackendScope
,
BACKENDS
from
.
import
common_utils
from
.compliance
import
utils
as
compliance_utils
from
.common_utils
import
AudioBackendScope
,
BACKENDS
def
extract_window
(
window
,
wave
,
f
,
frame_length
,
frame_shift
,
snip_edges
):
...
...
@@ -50,7 +50,7 @@ class Test_Kaldi(unittest.TestCase):
test_filepath
=
common_utils
.
get_asset_path
(
'kaldi_file.wav'
)
test_8000_filepath
=
common_utils
.
get_asset_path
(
'kaldi_file_8000.wav'
)
kaldi_output_dir
=
common_utils
.
get_asset_path
(
'kaldi'
)
test_filepaths
=
{
prefix
:
[]
for
prefix
in
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
):
...
...
@@ -151,7 +151,7 @@ class Test_Kaldi(unittest.TestCase):
args
=
f
.
split
(
'-'
)
args
[
-
1
]
=
os
.
path
.
splitext
(
args
[
-
1
])[
0
]
assert
len
(
args
)
==
expected_num_args
,
'invalid test kaldi file name'
args
=
[
compliance
.
utils
.
parse
(
arg
)
for
arg
in
args
]
args
=
[
compliance
_
utils
.
parse
(
arg
)
for
arg
in
args
]
output
=
get_output_fn
(
sound
,
args
)
...
...
test/test_dataloader.py
View file @
da59f597
...
...
@@ -3,8 +3,8 @@ import unittest
import
torchaudio
from
torch.utils.data
import
Dataset
,
DataLoader
import
common_utils
from
common_utils
import
AudioBackendScope
,
BACKENDS
from
.
import
common_utils
from
.
common_utils
import
AudioBackendScope
,
BACKENDS
class
TORCHAUDIODS
(
Dataset
):
...
...
test/test_datasets.py
View file @
da59f597
...
...
@@ -8,7 +8,7 @@ from torchaudio.datasets.vctk import VCTK
from
torchaudio.datasets.yesno
import
YESNO
from
torchaudio.datasets.ljspeech
import
LJSPEECH
import
common_utils
from
.
import
common_utils
class
TestDatasets
(
unittest
.
TestCase
):
...
...
test/test_functional.py
View file @
da59f597
...
...
@@ -6,7 +6,7 @@ import torchaudio
import
torchaudio.functional
as
F
import
pytest
import
common_utils
from
.
import
common_utils
class
Lfilter
(
common_utils
.
TestBaseMixin
):
...
...
test/test_io.py
View file @
da59f597
...
...
@@ -3,7 +3,7 @@ import torch
import
torchaudio
import
math
import
os
from
common_utils
import
AudioBackendScope
,
BACKENDS
,
BACKENDS_MP3
,
create_temp_assets_dir
from
.
common_utils
import
AudioBackendScope
,
BACKENDS
,
BACKENDS_MP3
,
create_temp_assets_dir
class
Test_LoadSave
(
unittest
.
TestCase
):
...
...
test/test_kaldi_io.py
View file @
da59f597
...
...
@@ -3,7 +3,7 @@ import unittest
import
torch
import
torchaudio.kaldi_io
as
kio
import
common_utils
from
.
import
common_utils
class
Test_KaldiIO
(
unittest
.
TestCase
):
...
...
test/test_librosa_compatibility.py
View file @
da59f597
"""Test suites for numerical compatibility with librosa"""
import
os
import
unittest
from
distutils.version
import
StrictVersion
import
torch
from
torch.testing._internal.common_utils
import
TestCase
...
...
@@ -15,7 +16,7 @@ if IMPORT_LIBROSA:
import
pytest
import
common_utils
from
.
import
common_utils
@
unittest
.
skipIf
(
not
IMPORT_LIBROSA
,
"Librosa not available"
)
...
...
@@ -74,6 +75,8 @@ class TestFunctional(TestCase):
self
.
_test_create_fb
(
n_mels
=
56
,
fmin
=
800.0
,
fmax
=
900.0
)
self
.
_test_create_fb
(
n_mels
=
56
,
fmin
=
1900.0
,
fmax
=
900.0
)
self
.
_test_create_fb
(
n_mels
=
10
,
fmin
=
1900.0
,
fmax
=
900.0
)
if
StrictVersion
(
librosa
.
__version__
)
<
StrictVersion
(
"0.7.2"
):
return
self
.
_test_create_fb
(
n_mels
=
128
,
sample_rate
=
44100
,
norm
=
"slaney"
)
self
.
_test_create_fb
(
n_mels
=
128
,
fmin
=
2000.0
,
fmax
=
5000.0
,
norm
=
"slaney"
)
self
.
_test_create_fb
(
n_mels
=
56
,
fmin
=
100.0
,
fmax
=
9000.0
,
norm
=
"slaney"
)
...
...
test/test_sox_compatibility.py
View file @
da59f597
...
...
@@ -6,8 +6,8 @@ import torchaudio
import
torchaudio.functional
as
F
import
torchaudio.transforms
as
T
import
common_utils
from
common_utils
import
AudioBackendScope
,
BACKENDS
from
.
import
common_utils
from
.
common_utils
import
AudioBackendScope
,
BACKENDS
class
TestFunctionalFiltering
(
TestCase
):
...
...
test/test_sox_effects.py
View file @
da59f597
...
...
@@ -3,8 +3,8 @@ import torch
import
torchaudio
import
math
import
common_utils
from
common_utils
import
AudioBackendScope
,
BACKENDS
from
.
import
common_utils
from
.
common_utils
import
AudioBackendScope
,
BACKENDS
class
Test_SoxEffectsChain
(
unittest
.
TestCase
):
...
...
test/test_transforms.py
View file @
da59f597
...
...
@@ -7,7 +7,7 @@ import torchaudio
import
torchaudio.transforms
as
transforms
import
torchaudio.functional
as
F
import
common_utils
from
.
import
common_utils
class
Tester
(
TestCase
):
...
...
test/torchscript_consistency_cpu_test.py
View file @
da59f597
from
common_utils
import
define_test_suites
from
torchscript_consistency_impl
import
Functional
,
Transforms
from
.
common_utils
import
define_test_suites
from
.
torchscript_consistency_impl
import
Functional
,
Transforms
define_test_suites
(
globals
(),
[
Functional
,
Transforms
],
devices
=
[
'cpu'
])
test/torchscript_consistency_cuda_test.py
View file @
da59f597
from
common_utils
import
define_test_suites
from
torchscript_consistency_impl
import
Functional
,
Transforms
from
.
common_utils
import
define_test_suites
from
.
torchscript_consistency_impl
import
Functional
,
Transforms
define_test_suites
(
globals
(),
[
Functional
,
Transforms
],
devices
=
[
'cuda'
])
test/torchscript_consistency_impl.py
View file @
da59f597
...
...
@@ -6,7 +6,7 @@ import torchaudio
import
torchaudio.functional
as
F
import
torchaudio.transforms
as
T
import
common_utils
from
.
import
common_utils
class
Functional
(
common_utils
.
TestBaseMixin
):
...
...
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