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
0b1d1f06
Unverified
Commit
0b1d1f06
authored
Mar 10, 2021
by
pw2406
Committed by
GitHub
Mar 10, 2021
Browse files
Add TorchScript test for `F.phase_vocoder` (#1379)
parent
ea857940
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
test/torchaudio_unittest/functional/torchscript_consistency_impl.py
...audio_unittest/functional/torchscript_consistency_impl.py
+15
-0
No files found.
test/torchaudio_unittest/functional/torchscript_consistency_impl.py
View file @
0b1d1f06
...
...
@@ -547,6 +547,21 @@ class Functional(common_utils.TestBaseMixin):
tensor
=
common_utils
.
get_whitenoise
(
sample_rate
=
44100
)
self
.
_assert_consistency
(
func
,
tensor
)
def
test_phase_vocoder
(
self
):
def
func
(
tensor
,
device
:
torch
.
device
=
self
.
device
):
rate
=
0.5
hop_length
=
256
phase_advance
=
torch
.
linspace
(
0
,
3.14
*
hop_length
,
tensor
.
shape
[
-
3
],
dtype
=
torch
.
float64
,
).
to
(
device
)[...,
None
]
return
F
.
phase_vocoder
(
tensor
,
rate
,
phase_advance
)
tensor
=
torch
.
randn
(
2
,
1025
,
400
,
2
)
self
.
_assert_consistency
(
func
,
tensor
)
@
common_utils
.
skipIfNoKaldi
def
test_compute_kaldi_pitch
(
self
):
if
self
.
dtype
!=
torch
.
float32
or
self
.
device
!=
torch
.
device
(
'cpu'
):
...
...
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