7633129ba8d5f0e28bd6b6d6027b14352482ef31,fairseq/data/token_block_dataset.py,TokenBlockDataset,prefetch,#TokenBlockDataset#Any#,104

Before Change


        for idx in indices:
            s, e = self.slice_indices[idx]
            self.dataset.read_into(s, self.cache[start:start + e - s])
            self.cache_index[idx] = (start, start + e - s)
            start += e - s

    @property
    def supports_prefetch(self):

After Change


        return getattr(self.dataset, "supports_prefetch", False)

    def prefetch(self, indices):
        self.dataset.prefetch({
            ds_idx
            for index in indices
            for start_ds_idx, _, end_ds_idx in [self.block_to_dataset_index[index]]
            for ds_idx in range(start_ds_idx, end_ds_idx + 1)
        })
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 7

Instances


Project Name: pytorch/fairseq
Commit Name: 7633129ba8d5f0e28bd6b6d6027b14352482ef31
Time: 2019-01-04
Author: myleott@fb.com
File Name: fairseq/data/token_block_dataset.py
Class Name: TokenBlockDataset
Method Name: prefetch


Project Name: IBM/adversarial-robustness-toolbox
Commit Name: 4f26187138c13437bbce511e21fe6635f5fef6ee
Time: 2019-07-15
Author: beat.buesser@ie.ibm.com
File Name: art/classifiers/classifier.py
Class Name: ClassifierNeuralNetwork
Method Name: __repr__


Project Name: IBM/adversarial-robustness-toolbox
Commit Name: 4f26187138c13437bbce511e21fe6635f5fef6ee
Time: 2019-07-15
Author: beat.buesser@ie.ibm.com
File Name: art/classifiers/classifier.py
Class Name: Classifier
Method Name: __repr__