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
0b93ff06
Commit
0b93ff06
authored
Aug 19, 2018
by
David Pollack
Committed by
Soumith Chintala
Aug 19, 2018
Browse files
torch.cos not implemented for LongTensor fix (#58)
parent
24bcf559
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
test/test.py
test/test.py
+1
-1
test/test_transforms.py
test/test_transforms.py
+1
-1
No files found.
test/test.py
View file @
0b93ff06
...
...
@@ -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
()
...
...
test/test_transforms.py
View file @
0b93ff06
...
...
@@ -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
()
...
...
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