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
hehl2
Torchaudio
Commits
e868d24c
"docs/en/understand_mmcv/data_process.md" did not exist on "90a0f353ee9fb1a6f95d82451825b354c03c5ab4"
Unverified
Commit
e868d24c
authored
Mar 05, 2021
by
Aobo Yang
Committed by
GitHub
Mar 05, 2021
Browse files
Add test for validating lfilter shape (#1360)
parent
7ab08200
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
test/torchaudio_unittest/functional/functional_impl.py
test/torchaudio_unittest/functional/functional_impl.py
+14
-0
No files found.
test/torchaudio_unittest/functional/functional_impl.py
View file @
e868d24c
...
...
@@ -31,6 +31,20 @@ class Lfilter(common_utils.TestBaseMixin):
output_signal
=
F
.
lfilter
(
input_signal
,
a_coeffs
,
b_coeffs
,
clamp
=
False
)
assert
output_signal
.
max
()
>
1
@
parameterized
.
expand
([
((
44100
,),),
((
3
,
44100
),),
((
2
,
3
,
44100
),),
((
1
,
2
,
3
,
44100
),)
])
def
test_shape
(
self
,
shape
):
torch
.
random
.
manual_seed
(
42
)
waveform
=
torch
.
rand
(
*
shape
,
dtype
=
self
.
dtype
,
device
=
self
.
device
)
b_coeffs
=
torch
.
tensor
([
0
,
0
,
0
,
1
],
dtype
=
self
.
dtype
,
device
=
self
.
device
)
a_coeffs
=
torch
.
tensor
([
1
,
0
,
0
,
0
],
dtype
=
self
.
dtype
,
device
=
self
.
device
)
output_waveform
=
F
.
lfilter
(
waveform
,
a_coeffs
,
b_coeffs
)
assert
shape
==
waveform
.
size
()
==
output_waveform
.
size
()
class
Spectrogram
(
common_utils
.
TestBaseMixin
):
@
parameterized
.
expand
([(
0.
,
),
(
1.
,
),
(
2.
,
),
(
3.
,
)])
...
...
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