Skip to content

Commit 97ceaad

Browse files
committed
Use explicit seed and only generate on cpu
1 parent e86e098 commit 97ceaad

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/torchaudio_unittest/functional/kaldi_compatibility_test_impl.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ def test_sliding_window_cmn(self):
1818
"norm_vars": False,
1919
}
2020

21-
tensor = torch.randn(40, 10, dtype=self.dtype, device=self.device)
21+
torch.manual_seed(0)
22+
tensor = torch.randn(40, 10, dtype=self.dtype).to(self.device)
2223
result = F.sliding_window_cmn(tensor, **kwargs)
2324
command = ["apply-cmvn-sliding"] + convert_args(**kwargs) + ["ark:-", "ark:-"]
2425
kaldi_result = run_kaldi(self.request, command, "ark", tensor)

0 commit comments

Comments
 (0)