8771290e987cd693bc38ad9339ac4cc6a70d6d2c,pytext/data/test/tensorizers_test.py,TensorizersTest,test_create_byte_tensors,#TensorizersTest#,73

Before Change



        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)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: facebookresearch/pytext
Commit Name: 8771290e987cd693bc38ad9339ac4cc6a70d6d2c
Time: 2019-02-28
Author: barlaso@fb.com
File Name: pytext/data/test/tensorizers_test.py
Class Name: TensorizersTest
Method Name: test_create_byte_tensors


Project Name: facebookresearch/pytext
Commit Name: b0adc22179a036abeecb79424ba94df64e052e9b
Time: 2019-12-17
Author: chenyangyu@fb.com
File Name: pytext/data/bert_tensorizer.py
Class Name: BERTTensorizerBase
Method Name: numberize


Project Name: facebookresearch/pytext
Commit Name: eba7183bd6fd90dd15c5daa260a836c64682018c
Time: 2019-12-19
Author: chenyangyu@fb.com
File Name: pytext/data/bert_tensorizer.py
Class Name: BERTTensorizerBase
Method Name: numberize