Commit 0b93ff06 authored by David Pollack's avatar David Pollack Committed by Soumith Chintala
Browse files

torch.cos not implemented for LongTensor fix (#58)

parent 24bcf559
......@@ -92,7 +92,7 @@ class Test_LoadSave(unittest.TestCase):
volume = 0.3
y = (torch.cos(
2 * math.pi * torch.arange(0, 4 * sr) * freq / sr)).float()
2 * math.pi * torch.arange(0, 4 * sr).float() * freq / sr))
y.unsqueeze_(1)
# y is between -1 and 1, so must scale
y = (y * volume * 2**31).long()
......
......@@ -11,7 +11,7 @@ class Tester(unittest.TestCase):
sr = 16000
freq = 440
volume = .3
sig = (torch.cos(2 * np.pi * torch.arange(0, 4 * sr) * freq / sr)).float()
sig = (torch.cos(2 * np.pi * torch.arange(0, 4 * sr).float() * freq / sr))
# sig = (torch.cos((1+torch.arange(0, 4 * sr) * 2) / sr * 2 * np.pi * torch.arange(0, 4 * sr) * freq / sr)).float()
sig.unsqueeze_(1)
sig = (sig * volume * 2**31).long()
......
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