batch = [{"text": types.Text(s1)}, {"text": types.Text(s2)}]
expected = [
[ord(c) for c in s1] + [0] * (max(-ld, 0)),
[ord(c) for c in s2] + [0] * (max(ld, 0)),
]
After Change
rows = [{"text": types.Text(s1)}, {"text": types.Text(s2)}]
expected = [[ord(c) for c in s1], [ord(c) for c in s2]]
tensors = (tensorizer.numberize(row) for row in rows)
chars, seq_len = next(tensors)
self.assertEqual(len(s1), len(chars))
self.assertEqual(expected[0], chars)