c8e736abf951301a28c2cd6f2c5a80b370c31e59,torch_geometric/transforms/gdc.py,GDC,__calc_ppr__,#,499

Before Change


        
        alpha_eps = alpha * eps
        js = []
        vals = []
        for inode in range(len(out_degree)):
            p = {inode: 0.0}
            r = {}
            r[inode] = alpha
            q = [inode]
            while len(q) > 0:
                unode = q.pop()

                res = r[unode] if unode in r else 0
                if unode in p:
                    p[unode] += res
                else:
                    p[unode] = res
                r[unode] = 0
                for vnode in indices[indptr[unode]:indptr[unode + 1]]:
                    _val = (1 - alpha) * res / out_degree[unode]
                    if vnode in r:
                        r[vnode] += _val
                    else:
                        r[vnode] = _val

                    res_vnode = r[vnode] if vnode in r else 0
                    if res_vnode >= alpha_eps * out_degree[vnode]:
                        if vnode not in q:
                            q.append(vnode)
            js.append(list(p.keys()))
            vals.append(list(p.values()))
        return js, vals

    def __repr__(self):
        return "{}()".format(self.__class__.__name__)

After Change


        
        alpha_eps = alpha * eps
        js = [[0]] * len(out_degree)
        vals = [[0.]] * len(out_degree)
        for inode_uint in numba.prange(len(out_degree)):
            inode = numba.int64(inode_uint)
            p = {inode: 0.0}
            r = {}
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 6

Instances


Project Name: rusty1s/pytorch_geometric
Commit Name: c8e736abf951301a28c2cd6f2c5a80b370c31e59
Time: 2020-08-20
Author: klicpera@in.tum.de
File Name: torch_geometric/transforms/gdc.py
Class Name: GDC
Method Name: __calc_ppr__


Project Name: tiberiu44/TTS-Cube
Commit Name: 2c6ce0ebfa9537246878e8fb9144e0c879fca17d
Time: 2018-10-22
Author: tibi@racai.ro
File Name: cube/models/vocoder.py
Class Name: BeeCoder
Method Name: synthesize


Project Name: vitchyr/rlkit
Commit Name: 9bdbb11cf27060e7847a87dcdf691dd6b96ce6df
Time: 2020-08-09
Author: 38036768+YangRui2015@users.noreply.github.com
File Name: rlkit/data_management/obs_dict_replay_buffer.py
Class Name: ObsDictRelabelingBuffer
Method Name: random_batch


Project Name: dgasmith/opt_einsum
Commit Name: a2afaa41a13548806ef624f1530d2ae8912bb818
Time: 2018-02-12
Author: john.gray.14@ucl.ac.uk
File Name: opt_einsum/paths.py
Class Name:
Method Name: greedy