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
34f3c12e
Commit
34f3c12e
authored
Dec 24, 2019
by
Charles J.Y. Yoon
Committed by
Vincent QB
Dec 23, 2019
Browse files
Module GPU test fixes (#369)
* Fixed GPU tests
parent
f3365ecf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
torchaudio/transforms.py
torchaudio/transforms.py
+3
-3
No files found.
torchaudio/transforms.py
View file @
34f3c12e
...
...
@@ -51,7 +51,7 @@ class Spectrogram(torch.nn.Module):
self
.
win_length
=
win_length
if
win_length
is
not
None
else
n_fft
self
.
hop_length
=
hop_length
if
hop_length
is
not
None
else
self
.
win_length
//
2
window
=
window_fn
(
self
.
win_length
)
if
wkwargs
is
None
else
window_fn
(
self
.
win_length
,
**
wkwargs
)
self
.
window
=
window
self
.
register_buffer
(
'
window
'
,
window
)
self
.
pad
=
pad
self
.
power
=
power
self
.
normalized
=
normalized
...
...
@@ -136,7 +136,7 @@ class MelScale(torch.nn.Module):
fb
=
torch
.
empty
(
0
)
if
n_stft
is
None
else
F
.
create_fb_matrix
(
n_stft
,
self
.
f_min
,
self
.
f_max
,
self
.
n_mels
,
self
.
sample_rate
)
self
.
fb
=
fb
self
.
register_buffer
(
'fb'
,
fb
)
def
forward
(
self
,
specgram
):
r
"""
...
...
@@ -260,7 +260,7 @@ class MFCC(torch.nn.Module):
if
self
.
n_mfcc
>
self
.
MelSpectrogram
.
n_mels
:
raise
ValueError
(
'Cannot select more MFCC coefficients than # mel bins'
)
dct_mat
=
F
.
create_dct
(
self
.
n_mfcc
,
self
.
MelSpectrogram
.
n_mels
,
self
.
norm
)
self
.
dct_mat
=
dct_mat
self
.
register_buffer
(
'
dct_mat
'
,
dct_mat
)
self
.
log_mels
=
log_mels
def
forward
(
self
,
waveform
):
...
...
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