55b557f17385ca10b8a3e8fb8bbb0d3799906db5,src/sdk/pynni/nni/compression/tensorflow/builtin_pruners.py,FPGMPruner,_get_min_gm_kernel_idx,#FPGMPruner#Any#Any#,177

Before Change


            for out_i in range(weight.shape[1]):
                dist_sum = self._get_distance_sum(weight, in_i, out_i)
                dist_list.append(dist_sum)
                idx_list.append([in_i, out_i])
        dist_tensor = tf.convert_to_tensor(dist_list)
        idx_tensor = tf.constant(idx_list)

After Change


            for out_i in range(weight.shape[1]):
                dist_sum = self._get_distance_sum(weight, in_i, out_i)
                dist_list.append((dist_sum, (in_i, out_i)))
        min_gm_kernels = sorted(dist_list, key=lambda x: x[0])[:n]
        return [x[1] for x in min_gm_kernels]

    def _get_distance_sum(self, weight, in_idx, out_idx):
        w = tf.reshape(weight, (-1, weight.shape[-2], weight.shape[-1]))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: microsoft/nni
Commit Name: 55b557f17385ca10b8a3e8fb8bbb0d3799906db5
Time: 2019-11-20
Author: 38930155+chicm-ms@users.noreply.github.com
File Name: src/sdk/pynni/nni/compression/tensorflow/builtin_pruners.py
Class Name: FPGMPruner
Method Name: _get_min_gm_kernel_idx


Project Name: wkentaro/labelme
Commit Name: 5c76adda68f8cfb897aa7a2160f284da0bd2f888
Time: 2020-05-27
Author: www.kentaro.wada@gmail.com
File Name: examples/instance_segmentation/labelme2coco.py
Class Name:
Method Name: main


Project Name: OpenNMT/OpenNMT-py
Commit Name: 685126644ae540be72eb662527269a0395e2c9eb
Time: 2017-09-05
Author: bpeters@coli.uni-saarland.de
File Name: onmt/IO.py
Class Name:
Method Name: make_features