class_docstr: A structured pruning algorithm that prunes the filters with the smallest
  importance approximations based on the first order taylor expansion on the weight.
  Molchanov, Pavlo and Mallya, Arun and Tyree, Stephen and Frosio, Iuri and Kautz, Jan,
  "Importance Estimation for Neural Network Pruning", CVPR 2019.
  http://jankautz.com/publications/Importance4NNPruning_CVPR19.pdf
class_docstr_tok: ["A","structured","pruning","algorithm","that","prunes","the","filters","with","the","smallest","importance","approximations","based","on","the","first","order","taylor","expansion","on","the","weight",".","Molchanov",",","Pavlo","and","Mallya",",","Arun","and","Tyree",",","Stephen","and","Frosio",",","Iuri","and","Kautz",",","Jan",",","''","Importance","Estimation","for","Neural","Network","Pruning","''",",","CVPR","2019.","http",":","\/\/jankautz.com\/publications\/Importance4NNPruning_CVPR19.pdf"]
docstr: Calculate the estimated importance of filters as a sum of individual contribution
  based on the first order taylor expansion.
docstr_tok: ["Calculate","the","estimated","importance","of","filters","as","a","sum","of","individual","contribution","based","on","the","first","order","taylor","expansion","."]
code: def calc_contributions(self):
      """
      Calculate the estimated importance of filters as a sum of individual contribution
      based on the first order taylor expansion.
      """
      if self.pruner.iterations >= self.pruner.statistics_batch_num:
          return
      for wrapper in self.pruner.get_modules_wrapper():
          filters = wrapper.module.weight.size(0)
          contribution = (
              (wrapper.module.weight * wrapper.module.weight.grad)
              .data.pow(2)
              .view(filters, -1)
              .sum(dim=1)
          )
          if wrapper.contribution is None:
              wrapper.contribution = contribution
          else:
              wrapper.contribution += contribution
  
      self.pruner.iterations += 1
  
imports: import logging
  import math
  import numpy
  import torch
  from .weight_masker import WeightMasker
label_desc: Use image node_id 3 for calling the TaylorFOWeightFilterPrunerMasker obj's underlying member method code with example usage: obj.calc_contributions() without return types