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
404fa12a
Unverified
Commit
404fa12a
authored
Apr 02, 2021
by
Krishna Kalyan
Committed by
GitHub
Apr 02, 2021
Browse files
Autograd tests for Transforms MFCC (#1415)
Co-authored-by:
krishnakalyan3
<
skalyan@cloudera.com
>
parent
52decd2a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
test/torchaudio_unittest/transforms/autograd_test_impl.py
test/torchaudio_unittest/transforms/autograd_test_impl.py
+7
-0
No files found.
test/torchaudio_unittest/transforms/autograd_test_impl.py
View file @
404fa12a
...
@@ -60,3 +60,10 @@ class AutogradTestMixin(TestBaseMixin):
...
@@ -60,3 +60,10 @@ class AutogradTestMixin(TestBaseMixin):
transform
=
T
.
MelSpectrogram
(
sample_rate
=
sample_rate
)
transform
=
T
.
MelSpectrogram
(
sample_rate
=
sample_rate
)
waveform
=
get_whitenoise
(
sample_rate
=
sample_rate
,
duration
=
0.05
,
n_channels
=
2
)
waveform
=
get_whitenoise
(
sample_rate
=
sample_rate
,
duration
=
0.05
,
n_channels
=
2
)
self
.
assert_grad
(
transform
,
[
waveform
],
nondet_tol
=
1e-10
)
self
.
assert_grad
(
transform
,
[
waveform
],
nondet_tol
=
1e-10
)
@
parameterized
.
expand
([(
False
,
),
(
True
,
)])
def
test_mfcc
(
self
,
log_mels
):
sample_rate
=
8000
transform
=
T
.
MFCC
(
sample_rate
=
sample_rate
,
log_mels
=
log_mels
)
waveform
=
get_whitenoise
(
sample_rate
=
sample_rate
,
duration
=
0.05
,
n_channels
=
2
)
self
.
assert_grad
(
transform
,
[
waveform
])
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