class_docstr: A structured pruning masker base class that prunes convolutional layer filters.
  
  Parameters
  ----------
  model: nn.Module
      model to be pruned
  pruner: Pruner
      A Pruner instance used to prune the model
  preserve_round: int
      after pruning, preserve filters/channels round to `preserve_round`, for example:
      for a Conv2d layer, output channel is 32, sparsity is 0.2, if preserve_round is
      1 (no preserve round), then there will be int(32 * 0.2) = 6 filters pruned, and
      32 - 6 = 26 filters are preserved. If preserve_round is 4, preserved filters will
      be round up to 28 (which can be divided by 4) and only 4 filters are pruned.
class_docstr_tok: ["A","structured","pruning","masker","base","class","that","prunes","convolutional","layer","filters",".","Parameters","--","--","--","--","--","model",":","nn.Module","model","to","be","pruned","pruner",":","Pruner","A","Pruner","instance","used","to","prune","the","model","preserve_round",":","int","after","pruning",",","preserve","filters\/channels","round","to","`","preserve_round","`",",","for","example",":","for","a","Conv2d","layer",",","output","channel","is","32",",","sparsity","is","0.2",",","if","preserve_round","is","1","(","no","preserve","round",")",",","then","there","will","be","int","(","32","*","0.2",")","=","6","filters","pruned",",","and","32","-","6","=","26","filters","are","preserved",".","If","preserve_round","is","4",",","preserved","filters","will","be","round","up","to","28","(","which","can","be","divided","by","4",")","and","only","4","filters","are","pruned","."]
docstr: Calculate the importance weight for each channel. If want to support the
  dependency-aware mode for this one-shot pruner, this function must be
  implemented.
  Parameters
  ----------
  wrapper: PrunerModuleWrapper
      layer wrapper of this layer
  wrapper_idx: int
      index of this wrapper in pruner's all wrappers
  Returns
  -------
  tensor
      Tensor that indicates the importance of each channel
docstr_tok: ["Calculate","the","importance","weight","for","each","channel",".","If","want","to","support","the","dependency-aware","mode","for","this","one-shot","pruner",",","this","function","must","be","implemented",".","Parameters","--","--","--","--","--","wrapper",":","PrunerModuleWrapper","layer","wrapper","of","this","layer","wrapper_idx",":","int","index","of","this","wrapper","in","pruner","'s","all","wrappers","Returns","--","--","--","-","tensor","Tensor","that","indicates","the","importance","of","each","channel"]
code: def get_channel_sum(self, wrapper, wrapper_idx):
      """
      Calculate the importance weight for each channel. If want to support the
      dependency-aware mode for this one-shot pruner, this function must be
      implemented.
      Parameters
      ----------
      wrapper: PrunerModuleWrapper
          layer wrapper of this layer
      wrapper_idx: int
          index of this wrapper in pruner's all wrappers
      Returns
      -------
      tensor
          Tensor that indicates the importance of each channel
      """
      raise NotImplementedError(
          "{} get_channel_sum is not implemented".format(
              self.__class__.__name__
          )
      )
  
imports: import logging
  import math
  import numpy
  import torch
  from .weight_masker import WeightMasker
label_desc: Use image node_id 8 for calling the StructuredWeightMasker obj's underlying member method code with example usage: obj.get_channel_sum(wrapper, wrapper_idx) without return types