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
51e27933
Commit
51e27933
authored
May 20, 2019
by
Jason Lian
Browse files
Use default type instead of float32
parent
1e23d214
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
torchaudio/functional.py
torchaudio/functional.py
+2
-2
No files found.
torchaudio/functional.py
View file @
51e27933
...
...
@@ -245,8 +245,8 @@ def create_dct(n_mfcc, n_mels, norm):
outdim
=
n_mfcc
dim
=
n_mels
# http://en.wikipedia.org/wiki/Discrete_cosine_transform#DCT-II
n
=
torch
.
arange
(
dim
,
dtype
=
torch
.
float32
)
k
=
torch
.
arange
(
outdim
,
dtype
=
torch
.
float32
)[:,
None
]
n
=
torch
.
arange
(
dim
,
dtype
=
torch
.
get_default_dtype
()
)
k
=
torch
.
arange
(
outdim
,
dtype
=
torch
.
get_default_dtype
()
)[:,
None
]
dct
=
torch
.
cos
(
math
.
pi
/
dim
*
(
n
+
0.5
)
*
k
)
if
norm
==
'ortho'
:
dct
[
0
]
*=
1.0
/
math
.
sqrt
(
2.0
)
...
...
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