8f54218a8ed67dc6c3df585ff89777b1e2bb2c26,pytext/optimizer/sparsifiers/tests/sparsifier_test.py,TestSparsifier,test_param_mask_with_pre_mask,#TestSparsifier#,87
Before Change
block_sz = 3
blockwise_sparsifier = self._get_blockwise_sparsifier(block_sz, sparsity)
param = torch.tensor([i for i in range(100)], dtype=float).view(10, 10)
pre_mask = torch.tensor([i % 2 for i in range(100)], dtype=float).view(10, 10)
block_l1_norms = param.new_zeros(param.shape)
// loop-based implementation to compute blockwise l1norm
abs_vals = []
for i in range(10):
After Change
)
)
nnz_unpruned = torch .nonzero(pre_mask).size(0)
max_num_nonzeros = math.ceil(nnz_unpruned * (1 - sparsity))
nnz_blocks = math.ceil(max_num_nonzeros / block_sz)
abs_vals.sort(reverse=True)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances Project Name: facebookresearch/pytext
Commit Name: 8f54218a8ed67dc6c3df585ff89777b1e2bb2c26
Time: 2019-12-06
Author: hyzhan@fb.com
File Name: pytext/optimizer/sparsifiers/tests/sparsifier_test.py
Class Name: TestSparsifier
Method Name: test_param_mask_with_pre_mask
Project Name: rusty1s/pytorch_geometric
Commit Name: b2002a8ef80ecbecee09fd61b910c987648455c7
Time: 2020-08-26
Author: matthias.fey@tu-dortmund.de
File Name: torch_geometric/datasets/karate.py
Class Name: KarateClub
Method Name: __init__
Project Name: NeuromorphicProcessorProject/snn_toolbox
Commit Name: 529f2a82727091b1b2b487afa89b4c02bbff04f1
Time: 2017-07-26
Author: bodo.rueckauer@gmail.com
File Name: snntoolbox/simulation/plotting.py
Class Name:
Method Name: plot_spiketrains