c0cb3275d7e2b25e4965763f7f83e7a89ef7c0e4,allennlp/data/iterators/basic_iterator.py,BasicIterator,_create_batches,#BasicIterator#Any#Any#,34

Before Change


        grouped_instances = group_by_count(instances, self._batch_size, None)
        // The last group might have not been full, so we check if any of the instances
        // are None, which is how group_by_count pads non-complete batches.
        grouped_instances[-1] = [instance for instance in grouped_instances[-1] if instance is not None]
        return (Batch(batch) for batch in grouped_instances)

    @classmethod
    def from_params(cls, params: Params) -> "BasicIterator":

After Change


            iterator = iter(instance_list)
            // Then break each memory-sized list into batches.
            for batch_instances in lazy_groups_of(iterator, self._batch_size):
                yield Batch(batch_instances)

    @classmethod
    def from_params(cls, params: Params) -> "BasicIterator":
        batch_size = params.pop_int("batch_size", 32)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: allenai/allennlp
Commit Name: c0cb3275d7e2b25e4965763f7f83e7a89ef7c0e4
Time: 2018-01-31
Author: joelgrus@gmail.com
File Name: allennlp/data/iterators/basic_iterator.py
Class Name: BasicIterator
Method Name: _create_batches


Project Name: allenai/allennlp
Commit Name: 675733b63e41cccbabf1d95ff2e90585bf33efba
Time: 2018-01-30
Author: joelgrus@gmail.com
File Name: allennlp/common/testing/model_test_case.py
Class Name: ModelTestCase
Method Name: ensure_batch_predictions_are_consistent


Project Name: allenai/allennlp
Commit Name: d4ee5db1c630d6c631a828ee12fcbf6154de288c
Time: 2018-06-29
Author: matt-peters@users.noreply.github.com
File Name: allennlp/data/iterators/bucket_iterator.py
Class Name: BucketIterator
Method Name: _create_batches