Skip to content

Commit a0d7af3

Browse files
committed
Add smoke test
1 parent ee05058 commit a0d7af3

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/test_encoders.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,3 +263,13 @@ def test_num_channels(
263263
if num_channels_output is None:
264264
num_channels_output = num_channels_input
265265
assert self.decode(encoded_source).shape[0] == num_channels_output
266+
267+
def test_1d_samples(self):
268+
# smoke test making sure 1D samples are supported
269+
samples_1d, sample_rate = torch.rand(1000), 16_000
270+
samples_2d = samples_1d[None, :]
271+
272+
torch.testing.assert_close(
273+
AudioEncoder(samples_1d, sample_rate=sample_rate).to_tensor("wav"),
274+
AudioEncoder(samples_2d, sample_rate=sample_rate).to_tensor("wav"),
275+
)

0 commit comments

Comments
 (0)