class_docstr: running blockwise magnitude-based sparsification
  
  Args:
      block_size: define the size of each block
  
      columnwise_blocking: define columnwise block if true
  
      starting_epoch: sparsification_condition returns true only after starting_epoch
  
      frequency: sparsification_condition only if number of steps devides frequency
  
      accumulate_mask: if true, the mask after each .sparisfy() will be reused
  
      sparsity: percentage of zeros among the **UNPRUNED** parameters.
  
  
      Examples on how the sparsifier work:
  
      2D matrix:
      [
        0  1  2  3  4
        5  6  7  8  9
        10 11 12 13 14
        15 16 17 18 19
        20 21 22 23 24
      ]
  
      define 3 X 1 block
      [
        *********  *******
        *0  1  2*  *3   4*
        ********** *******
        *5  6  7*  *8   9*
        ********** *******
        *10 11 12* *13 14*
        ********** *******
        *15 16 17* *18 19*
        ********** *******
        *20 21 22* *23 24*
        ********** *******
      ]
  
      compute l1 norm of each block and sort them. Retain blocks with largest
      absolute values until sparsity threshold is met
class_docstr_tok: ["running","blockwise","magnitude-based","sparsification","Args",":","block_size",":","define","the","size","of","each","block","columnwise_blocking",":","define","columnwise","block","if","true","starting_epoch",":","sparsification_condition","returns","true","only","after","starting_epoch","frequency",":","sparsification_condition","only","if","number","of","steps","devides","frequency","accumulate_mask",":","if","true",",","the","mask","after","each",".sparisfy","(",")","will","be","reused","sparsity",":","percentage","of","zeros","among","the","*","*","UNPRUNED","*","*","parameters",".","Examples","on","how","the","sparsifier","work",":","2D","matrix",":","[","0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","]","define","3","X","1","block","[","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","0","1","2","*","*","3","4","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","5","6","7","*","*","8","9","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","10","11","12","*","*","13","14","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","15","16","17","*","*","18","19","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","20","21","22","*","*","23","24","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","*","]","compute","l1","norm","of","each","block","and","sort","them",".","Retain","blocks","with","largest","absolute","values","until","sparsity","threshold","is","met"]
code: def get_current_sparsity(self, model):
      sparsifiable_params = self.get_sparsifiable_params(model)
      sparsifiable_params_count = sum(
          p.numel() for p in sparsifiable_params
      )
      nonzero_params = sum(
          p.nonzero().size(0) for p in sparsifiable_params
      )
      return (
          sparsifiable_params_count - nonzero_params
      ) / sparsifiable_params_count
  
file_path: pytext/pytext/optimizer/sparsifiers/blockwise_sparsifier.py
imports: import math
  from typing import List
  import torch
  import torch.nn
  from pytext.optimizer.sparsifiers.sparsifier import L0_projection_sparsifier
label_desc: Use image node_id 4 for calling the BlockwiseMagnitudeSparsifier obj's underlying member method code with example usage: obj.get_current_sparsity(model) and returns: unknown