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)
} )
In pattern: SUPERPATTERN
Frequency: 3
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: inspirehep/magpie
Commit Name: b6dafdaf674e09dad523563909bb510935b5f655
Time: 2016-01-08
Author: jan.stypka@cern.ch
File Name: magpie/evaluation/utils.py
Class Name:
Method Name: remove_unguessable_answers