2c4a6e537126f4123de7c97f30587310d3712c06,tests/data/fields/list_field_test.py,TestListField,test_get_padding_lengths,#TestListField#,29

Before Change


        super(TestListField, self).setUp()

    def test_get_padding_lengths(self):
        field1 = TextField(["this", "is", "a", "sentence"], self.word_indexer)
        field2 = TextField(["this", "is", "a", "different", "sentence"], self.word_indexer)
        field3 = TextField(["this", "is", "another", "sentence"], self.word_indexer)

        list_field = ListField([field1, field2, field3])
        list_field.index(self.vocab)
        lengths = list_field.get_padding_lengths()

After Change


        super(TestListField, self).setUp()

    def test_get_padding_lengths(self):
        list_field = ListField([self.field1, self.field2, self.field3])
        list_field.index(self.vocab)
        lengths = list_field.get_padding_lengths()
        assert lengths == {"num_fields": 3, "num_tokens": 5}
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 17

Instances


Project Name: allenai/allennlp
Commit Name: 2c4a6e537126f4123de7c97f30587310d3712c06
Time: 2017-09-13
Author: mattg@allenai.org
File Name: tests/data/fields/list_field_test.py
Class Name: TestListField
Method Name: test_get_padding_lengths


Project Name: allenai/allennlp
Commit Name: 2c4a6e537126f4123de7c97f30587310d3712c06
Time: 2017-09-13
Author: mattg@allenai.org
File Name: tests/data/fields/list_field_test.py
Class Name: TestListField
Method Name: test_get_padding_lengths


Project Name: allenai/allennlp
Commit Name: 2c4a6e537126f4123de7c97f30587310d3712c06
Time: 2017-09-13
Author: mattg@allenai.org
File Name: tests/data/fields/list_field_test.py
Class Name: TestListField
Method Name: test_all_fields_padded_to_max_length


Project Name: allenai/allennlp
Commit Name: 2c4a6e537126f4123de7c97f30587310d3712c06
Time: 2017-09-13
Author: mattg@allenai.org
File Name: tests/data/fields/list_field_test.py
Class Name: TestListField
Method Name: test_fields_can_pad_to_greater_than_max_length