Skip to content

Commit 5b5c764

Browse files
committed
norm test data
1 parent 2db31b8 commit 5b5c764

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/test_decode.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ def setUp(self):
1414
self.probs = self.get_random_data()
1515

1616
def get_random_data(self, samples=100):
17-
return np.random.rand(samples, len(self.alphabet)).astype(np.float32)
17+
x = np.random.rand(samples, len(self.alphabet)).astype(np.float32)
18+
return x / np.linalg.norm(x, ord=2, axis=1, keepdims=True)
1819

1920
def test_beam_search(self):
2021
""" simple beam search test with the canonical alphabet"""

0 commit comments

Comments
 (0)