a615533788c1842483a9708787db0d73902dc1ec,fairseq/multiprocessing_trainer.py,MultiprocessingTrainer,_scatter_samples,#MultiprocessingTrainer#Any#Any#,242

Before Change


        events = []
        for d in self.device_ids:
            with torch.cuda.device(d):
                event = torch.cuda.Event(interprocess=True)
                event.record()
                events.append(event)

        return res, events

After Change


        // Pad with None until its size is equal to the number of replicas.
        samples = samples + [None]*(self.num_replicas - len(samples))

        Future.gen_list([
            self.call_async(rank, "_async_prepare_sample", sample=samples[rank], volatile=volatile)
            for rank in range(self.num_replicas)
        ])

    def _async_prepare_sample(self, rank, device_id, sample, volatile):
        if sample is None:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: pytorch/fairseq
Commit Name: a615533788c1842483a9708787db0d73902dc1ec
Time: 2017-09-19
Author: myleott@fb.com
File Name: fairseq/multiprocessing_trainer.py
Class Name: MultiprocessingTrainer
Method Name: _scatter_samples


Project Name: tyarkoni/pliers
Commit Name: e5e5ee0c3f7f7438a2519d32458fa72ea7af98e4
Time: 2016-10-23
Author: quinten.mcnamara@gmail.com
File Name: featurex/extractors/google.py
Class Name: GoogleVisionAPIExtractor
Method Name: _extract