503a3579511fcb40642a09958dd5377875647309,src/sdk/pynni/nni/compression/torch/builtin_pruners.py,AGP_Pruner,calc_mask,#AGP_Pruner#,83

Before Change


                return mask
            // if we want to generate new mask, we should update weigth first
            w_abs = weight.abs() * mask
            threshold = torch.topk(w_abs.view(-1), k, largest=False).values.max()
            new_mask = torch.gt(w_abs, threshold).type_as(weight)
            self.mask_dict.update({op_name: new_mask})
            self.if_init_list.update({op_name: False})
        else:

After Change


                return mask
            // if we want to generate new mask, we should update weigth first
            w_abs = weight.abs() * mask
            threshold = torch.topk(w_abs.view(-1), k, largest=False)[0].max()
            new_mask = torch.gt(w_abs, threshold).type_as(weight)
            self.mask_dict.update({op_name: new_mask})
            self.if_init_list.update({op_name: False})
        else:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: microsoft/nni
Commit Name: 503a3579511fcb40642a09958dd5377875647309
Time: 2019-11-24
Author: lanny@mail.hfut.edu.cn
File Name: src/sdk/pynni/nni/compression/torch/builtin_pruners.py
Class Name: AGP_Pruner
Method Name: calc_mask


Project Name: microsoft/nni
Commit Name: 503a3579511fcb40642a09958dd5377875647309
Time: 2019-11-24
Author: lanny@mail.hfut.edu.cn
File Name: src/sdk/pynni/nni/compression/torch/builtin_pruners.py
Class Name: L1FilterPruner
Method Name: calc_mask


Project Name: microsoft/nni
Commit Name: 503a3579511fcb40642a09958dd5377875647309
Time: 2019-11-24
Author: lanny@mail.hfut.edu.cn
File Name: src/sdk/pynni/nni/compression/torch/builtin_pruners.py
Class Name: LevelPruner
Method Name: calc_mask