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
e964f93c
Unverified
Commit
e964f93c
authored
Apr 06, 2021
by
Chin-Yun Yu
Committed by
GitHub
Apr 05, 2021
Browse files
Add autograd test for T.ComputeDeltas (#1422)
parent
f0ab42ce
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
test/torchaudio_unittest/transforms/autograd_test_impl.py
test/torchaudio_unittest/transforms/autograd_test_impl.py
+5
-0
No files found.
test/torchaudio_unittest/transforms/autograd_test_impl.py
View file @
e964f93c
...
@@ -72,6 +72,11 @@ class AutogradTestMixin(TestBaseMixin):
...
@@ -72,6 +72,11 @@ class AutogradTestMixin(TestBaseMixin):
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
])
self
.
assert_grad
(
transform
,
[
waveform
])
def
test_compute_deltas
(
self
):
transform
=
T
.
ComputeDeltas
()
spec
=
torch
.
rand
(
10
,
20
)
self
.
assert_grad
(
transform
,
[
spec
])
@
parameterized
.
expand
([(
8000
,
8000
),
(
8000
,
4000
),
(
4000
,
8000
)])
@
parameterized
.
expand
([(
8000
,
8000
),
(
8000
,
4000
),
(
4000
,
8000
)])
def
test_resample
(
self
,
orig_freq
,
new_freq
):
def
test_resample
(
self
,
orig_freq
,
new_freq
):
transform
=
T
.
Resample
(
orig_freq
=
orig_freq
,
new_freq
=
new_freq
)
transform
=
T
.
Resample
(
orig_freq
=
orig_freq
,
new_freq
=
new_freq
)
...
...
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