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
48deca81
"torchvision/vscode:/vscode.git/clone" did not exist on "72d650ae0bf21f4d98cb8af5e308bddd88131d5e"
Unverified
Commit
48deca81
authored
Apr 19, 2021
by
dhthompson
Committed by
GitHub
Apr 19, 2021
Browse files
Add autograd test for T.Vol (#1460)
parent
5cca0008
Changes
1
Show 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 @
48deca81
...
@@ -137,6 +137,13 @@ class AutogradTestMixin(TestBaseMixin):
...
@@ -137,6 +137,13 @@ 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
])
@
parameterized
.
expand
([(
1.5
,
"amplitude"
),
(
2
,
"power"
),
(
10
,
"db"
)])
def
test_vol
(
self
,
gain
,
gain_type
):
sample_rate
=
8000
transform
=
T
.
Vol
(
gain
=
gain
,
gain_type
=
gain_type
)
waveform
=
get_whitenoise
(
sample_rate
=
sample_rate
,
duration
=
0.05
,
n_channels
=
2
)
self
.
assert_grad
(
transform
,
[
waveform
])
@
unittest
.
expectedFailure
@
unittest
.
expectedFailure
def
test_timestretch_zeros_fail
(
self
):
def
test_timestretch_zeros_fail
(
self
):
"""Test that ``T.TimeStretch`` fails gradcheck at 0
"""Test that ``T.TimeStretch`` fails gradcheck at 0
...
...
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