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
931555c1
Unverified
Commit
931555c1
authored
Apr 13, 2021
by
Krishna Kalyan
Committed by
GitHub
Apr 13, 2021
Browse files
Add autograd test for T.AmplitudeToDB (#1447)
parent
e911e5eb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
test/torchaudio_unittest/transforms/autograd_test_impl.py
test/torchaudio_unittest/transforms/autograd_test_impl.py
+6
-0
No files found.
test/torchaudio_unittest/transforms/autograd_test_impl.py
View file @
931555c1
...
@@ -123,3 +123,9 @@ class AutogradTestMixin(TestBaseMixin):
...
@@ -123,3 +123,9 @@ class AutogradTestMixin(TestBaseMixin):
transform
=
T
.
SpectralCentroid
(
sample_rate
=
sample_rate
)
transform
=
T
.
SpectralCentroid
(
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
)
def
test_amplitude_to_db
(
self
):
sample_rate
=
8000
transform
=
T
.
AmplitudeToDB
()
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