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
7d034ea7
"git@developer.sourcefind.cn:OpenDAS/pytorch3d.git" did not exist on "a94f3f4c4bf581ee056e1d18a46aa4ecba5ed89e"
Unverified
Commit
7d034ea7
authored
Apr 05, 2021
by
Krishna Kalyan
Committed by
GitHub
Apr 05, 2021
Browse files
Add autograd test for T.Fade (#1424)
parent
90311ed1
Changes
1
Hide 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 @
7d034ea7
...
@@ -77,3 +77,9 @@ class AutogradTestMixin(TestBaseMixin):
...
@@ -77,3 +77,9 @@ class AutogradTestMixin(TestBaseMixin):
transform
=
T
.
Resample
(
orig_freq
=
orig_freq
,
new_freq
=
new_freq
)
transform
=
T
.
Resample
(
orig_freq
=
orig_freq
,
new_freq
=
new_freq
)
waveform
=
get_whitenoise
(
sample_rate
=
8000
,
duration
=
0.05
,
n_channels
=
2
)
waveform
=
get_whitenoise
(
sample_rate
=
8000
,
duration
=
0.05
,
n_channels
=
2
)
self
.
assert_grad
(
transform
,
[
waveform
])
self
.
assert_grad
(
transform
,
[
waveform
])
@
parameterized
.
expand
([(
"linear"
,
),
(
"exponential"
,
),
(
"logarithmic"
,
),
(
"quarter_sine"
,
),
(
"half_sine"
,
)])
def
test_fade
(
self
,
fade_shape
):
transform
=
T
.
Fade
(
fade_shape
=
fade_shape
)
waveform
=
get_whitenoise
(
sample_rate
=
8000
,
duration
=
0.05
,
n_channels
=
2
)
self
.
assert_grad
(
transform
,
[
waveform
],
nondet_tol
=
1e-10
)
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