Unverified Commit 48630302 authored by Prabhat Roy's avatar Prabhat Roy Committed by GitHub
Browse files

Fixed floor_divide deprecation warnings seen in pytest output (#1455)

* Fixed floor_divide deprecation warnings seen in pytest output

* Fixed warning in test_flanger_triangle_linear
parent ad534c11
......@@ -199,7 +199,8 @@ class TestMaskAlongAxis(common_utils.TorchaudioTestCase):
masked_columns = (mask_specgram == mask_value).sum(other_axis)
num_masked_columns = (masked_columns == mask_specgram.size(other_axis)).sum()
num_masked_columns //= mask_specgram.size(0)
num_masked_columns = torch.div(
num_masked_columns, mask_specgram.size(0), rounding_mode='floor')
assert mask_specgram.size() == specgram.size()
assert num_masked_columns < mask_param
......
......@@ -46,7 +46,7 @@ def _generate_wave_table(
d = (torch.sin(point.to(torch.float64) / table_size * 2 * math.pi) + 1) / 2
elif wave_type == "TRIANGLE":
d = point.to(torch.float64) * 2 / table_size
value = 4 * point // table_size
value = torch.div(4 * point, table_size, rounding_mode='floor')
d[value == 0] = d[value == 0] + 0.5
d[value == 1] = 1.5 - d[value == 1]
d[value == 2] = 1.5 - d[value == 2]
......
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