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
50939b75
Unverified
Commit
50939b75
authored
Jun 11, 2020
by
moto
Committed by
GitHub
Jun 11, 2020
Browse files
Fix integer division (#714)
parent
d2724481
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
test/test_functional.py
test/test_functional.py
+1
-1
torchaudio/functional.py
torchaudio/functional.py
+1
-1
No files found.
test/test_functional.py
View file @
50939b75
...
@@ -381,7 +381,7 @@ def test_mask_along_axis(specgram, mask_param, mask_value, axis):
...
@@ -381,7 +381,7 @@ def test_mask_along_axis(specgram, mask_param, mask_value, axis):
masked_columns
=
(
mask_specgram
==
mask_value
).
sum
(
other_axis
)
masked_columns
=
(
mask_specgram
==
mask_value
).
sum
(
other_axis
)
num_masked_columns
=
(
masked_columns
==
mask_specgram
.
size
(
other_axis
)).
sum
()
num_masked_columns
=
(
masked_columns
==
mask_specgram
.
size
(
other_axis
)).
sum
()
num_masked_columns
/=
mask_specgram
.
size
(
0
)
num_masked_columns
/
/=
mask_specgram
.
size
(
0
)
assert
mask_specgram
.
size
()
==
specgram
.
size
()
assert
mask_specgram
.
size
()
==
specgram
.
size
()
assert
num_masked_columns
<
mask_param
assert
num_masked_columns
<
mask_param
...
...
torchaudio/functional.py
View file @
50939b75
...
@@ -1382,7 +1382,7 @@ def _generate_wave_table(
...
@@ -1382,7 +1382,7 @@ def _generate_wave_table(
d
=
(
torch
.
sin
(
point
.
to
(
torch
.
float64
)
/
table_size
*
2
*
math
.
pi
)
+
1
)
/
2
d
=
(
torch
.
sin
(
point
.
to
(
torch
.
float64
)
/
table_size
*
2
*
math
.
pi
)
+
1
)
/
2
elif
wave_type
==
'TRIANGLE'
:
elif
wave_type
==
'TRIANGLE'
:
d
=
point
.
to
(
torch
.
float64
)
*
2
/
table_size
d
=
point
.
to
(
torch
.
float64
)
*
2
/
table_size
value
=
4
*
point
/
table_size
value
=
4
*
point
/
/
table_size
d
[
value
==
0
]
=
d
[
value
==
0
]
+
0.5
d
[
value
==
0
]
=
d
[
value
==
0
]
+
0.5
d
[
value
==
1
]
=
1.5
-
d
[
value
==
1
]
d
[
value
==
1
]
=
1.5
-
d
[
value
==
1
]
d
[
value
==
2
]
=
1.5
-
d
[
value
==
2
]
d
[
value
==
2
]
=
1.5
-
d
[
value
==
2
]
...
...
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