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
"vscode:/vscode.git/clone" did not exist on "098602b08fdc92badf8331eab3deb6f56c5166f1"
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
Show 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):
...
@@ -51,7 +51,7 @@ class Spectrogram(torch.nn.Module):
self
.
win_length
=
win_length
if
win_length
is
not
None
else
n_fft
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
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
)
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
.
pad
=
pad
self
.
power
=
power
self
.
power
=
power
self
.
normalized
=
normalized
self
.
normalized
=
normalized
...
@@ -136,7 +136,7 @@ class MelScale(torch.nn.Module):
...
@@ -136,7 +136,7 @@ class MelScale(torch.nn.Module):
fb
=
torch
.
empty
(
0
)
if
n_stft
is
None
else
F
.
create_fb_matrix
(
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
)
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
):
def
forward
(
self
,
specgram
):
r
"""
r
"""
...
@@ -260,7 +260,7 @@ class MFCC(torch.nn.Module):
...
@@ -260,7 +260,7 @@ class MFCC(torch.nn.Module):
if
self
.
n_mfcc
>
self
.
MelSpectrogram
.
n_mels
:
if
self
.
n_mfcc
>
self
.
MelSpectrogram
.
n_mels
:
raise
ValueError
(
'Cannot select more MFCC coefficients than # mel bins'
)
raise
ValueError
(
'Cannot select more MFCC coefficients than # mel bins'
)
dct_mat
=
F
.
create_dct
(
self
.
n_mfcc
,
self
.
MelSpectrogram
.
n_mels
,
self
.
norm
)
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
self
.
log_mels
=
log_mels
def
forward
(
self
,
waveform
):
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