class_docstr: Weight maskser class for AMC pruner. Currently, AMCPruner only supports pruning kernel
  size 1x1 pointwise Conv2d layer. Before using this class to prune kernels, AMCPruner
  collected input and output feature maps for each layer, the features maps are flattened
  and save into wrapper.input_feat and wrapper.output_feat.
  
  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: ["Weight","maskser","class","for","AMC","pruner",".","Currently",",","AMCPruner","only","supports","pruning","kernel","size","1x1","pointwise","Conv2d","layer",".","Before","using","this","class","to","prune","kernels",",","AMCPruner","collected","input","and","output","feature","maps","for","each","layer",",","the","features","maps","are","flattened","and","save","into","wrapper.input_feat","and","wrapper.output_feat",".","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","."]
code: def __init__(self, model, pruner, preserve_round=1):
      self.model = model
      self.pruner = pruner
      self.preserve_round = preserve_round
  
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 AMCWeightMasker object from inherited base classes: WeightMasker with example: obj = AMCWeightMasker(model, pruner, preserve_round)