dd2d9ffaa04e6bfd7cf3c1dbd605ffe50b61f7bf,tensorpack/dataflow/parallel.py,MultiThreadPrefetchData,__init__,#MultiThreadPrefetchData#Any#Any#Any#,398

Before Change


        
        assert nr_thread > 0 and nr_prefetch > 0
        self.nr_thread = nr_thread
        self.queue = queue.Queue(maxsize=nr_prefetch)
        self.threads = [
            MultiThreadPrefetchData._Worker(get_df, self.queue)
            for _ in range(nr_thread)]

    def reset_state(self):
        for th in self.threads:
            th.df.reset_state()

After Change



    class _Worker(mp.Process):
        def __init__(self, ds, queue, idx):
            super(MultiProcessRunner._Worker, self).__init__()
            self.ds = ds
            self.queue = queue
            self.idx = idx
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: tensorpack/tensorpack
Commit Name: dd2d9ffaa04e6bfd7cf3c1dbd605ffe50b61f7bf
Time: 2019-05-25
Author: ppwwyyxx@users.noreply.github.com
File Name: tensorpack/dataflow/parallel.py
Class Name: MultiThreadPrefetchData
Method Name: __init__


Project Name: uber/petastorm
Commit Name: f57c6162ea1dd0d9958d647a67e717f1de9caace
Time: 2018-12-09
Author: yevgeni@uber.com
File Name: petastorm/reader.py
Class Name: Reader
Method Name: __next__


Project Name: mozilla/bugbug
Commit Name: 4ace4ef2fb1956ec4df46f78c9edd02154780913
Time: 2019-07-24
Author: cklyyung@users.noreply.github.com
File Name: bugbug/similarity.py
Class Name: Word2VecWmdSimilarity
Method Name: __init__