a3d053ee6de9b98d205cf3256e2d7f70c326d88a,gluon/gluoncv2/models/superpointnet.py,SPDescriptor,hybrid_forward,#SPDescriptor#Any#Any#Any#,249

Before Change


        desc_map = desc_map.reshape(shape=(0, 0, -1))
        desc_map = desc_map.transpose(axes=(0, 2, 1))

        desc_map_list = []

        def slice_desc_map(data, _):
            desc_map_list.append(data)
            return data, []
        F.contrib.foreach(slice_desc_map, desc_map, [])

        pts_ravel_list = []

        def ravel_pts(data, _):
            pts_ravel_list.append(F.ravel_multi_index(data, shape=(self.in_size[0], self.in_size[1])))
            return data, []
        pts_tr = pts.transpose(axes=(0, 2, 1))
        F.contrib.foreach(ravel_pts, pts_tr, [])

        desc_map_sorted_list = []
        for desc_map_i, pts_coord_ravel_i in zip(desc_map_list, pts_ravel_list):
            desc_map_sorted_i = F.take(desc_map_i, pts_coord_ravel_i)
            desc_map_sorted_list.append(desc_map_sorted_i)

        desc_map_sorted = F.stack(*desc_map_sorted_list)

        return desc_map_sorted

After Change


        pts_tr = pts.transpose(axes=(0, 2, 1))
        for i in range(self.batch_size):
            desc_map_i = desc_map[i]
            pts_tr_i = pts_tr[i].reshape(shape=(2, -1))
            pts_ravel_i = F.ravel_multi_index(pts_tr_i, shape=(self.in_size[0], self.in_size[1]))
            desc_map_sorted_i = F.take(desc_map_i, pts_ravel_i)
            desc_map_sorted_list.append(desc_map_sorted_i)
        desc_map_sorted = F.stack(*desc_map_sorted_list)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 7

Instances


Project Name: osmr/imgclsmob
Commit Name: a3d053ee6de9b98d205cf3256e2d7f70c326d88a
Time: 2019-06-22
Author: osemery@gmail.com
File Name: gluon/gluoncv2/models/superpointnet.py
Class Name: SPDescriptor
Method Name: hybrid_forward


Project Name: dpressel/mead-baseline
Commit Name: 4b4946f40ef0f8c533f5473ec3756e639e57e5c5
Time: 2018-09-28
Author: dpressel@gmail.com
File Name: python/baseline/dy/dynety.py
Class Name:
Method Name: show_examples_dynet


Project Name: deepchem/deepchem
Commit Name: a437991e12a334b40b082fdc8b1b6dcf4a68021f
Time: 2017-04-17
Author: bharath.ramsundar@gmail.com
File Name: deepchem/models/tensorgraph/layers.py
Class Name: NeighborList
Method Name: get_cells_for_atoms


Project Name: deepchem/deepchem
Commit Name: a437991e12a334b40b082fdc8b1b6dcf4a68021f
Time: 2017-04-17
Author: bharath.ramsundar@gmail.com
File Name: deepchem/models/tensorgraph/layers.py
Class Name: NeighborList
Method Name: get_neighbor_cells