Commit 51e27933 authored by Jason Lian's avatar Jason Lian
Browse files

Use default type instead of float32

parent 1e23d214
...@@ -245,8 +245,8 @@ def create_dct(n_mfcc, n_mels, norm): ...@@ -245,8 +245,8 @@ def create_dct(n_mfcc, n_mels, norm):
outdim = n_mfcc outdim = n_mfcc
dim = n_mels dim = n_mels
# http://en.wikipedia.org/wiki/Discrete_cosine_transform#DCT-II # http://en.wikipedia.org/wiki/Discrete_cosine_transform#DCT-II
n = torch.arange(dim, dtype=torch.float32) n = torch.arange(dim, dtype=torch.get_default_dtype())
k = torch.arange(outdim, dtype=torch.float32)[:, None] k = torch.arange(outdim, dtype=torch.get_default_dtype())[:, None]
dct = torch.cos(math.pi / dim * (n + 0.5) * k) dct = torch.cos(math.pi / dim * (n + 0.5) * k)
if norm == 'ortho': if norm == 'ortho':
dct[0] *= 1.0 / math.sqrt(2.0) dct[0] *= 1.0 / math.sqrt(2.0)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment