class_docstr: A structured pruning algorithm that prunes channels by pruning the weights of BN layers.
  Zhuang Liu, Jianguo Li, Zhiqiang Shen, Gao Huang, Shoumeng Yan and Changshui Zhang
  "Learning Efficient Convolutional Networks through Network Slimming", 2017 ICCV
  https://arxiv.org/pdf/1708.06519.pdf
class_docstr_tok: ["A","structured","pruning","algorithm","that","prunes","channels","by","pruning","the","weights","of","BN","layers",".","Zhuang","Liu",",","Jianguo","Li",",","Zhiqiang","Shen",",","Gao","Huang",",","Shoumeng","Yan","and","Changshui","Zhang","''","Learning","Efficient","Convolutional","Networks","through","Network","Slimming","''",",","2017","ICCV","https",":","\/\/arxiv.org\/pdf\/1708.06519.pdf"]
code: def __init__(self, model, pruner, **kwargs):
      super().__init__(model, pruner)
      weight_list = []
      for layer, _ in pruner.get_modules_to_compress():
          weight_list.append(layer.module.weight.data.abs().clone())
      all_bn_weights = torch.cat(weight_list)
      k = int(
          all_bn_weights.shape[0] * pruner.config_list[0]["sparsity"]
      )
      self.global_threshold = torch.topk(
          all_bn_weights.view(-1), k, largest=False
      )[0].max()
  
imports: import logging
  import math
  import numpy
  import torch
  from .weight_masker import WeightMasker
label_desc: Use image node_id 1 to create a new SlimPrunerMasker object from inherited base classes: WeightMasker with example: obj = SlimPrunerMasker(model, pruner)