neural_compressor.compression.pruner.pruners.block_mask
Block mask pruner.
Classes
Pruning Pruner. |
Module Contents
- class neural_compressor.compression.pruner.pruners.block_mask.PytorchBlockMaskPruner(config, modules)[source]
Pruning Pruner.
The class which executes pruning process. 1. Defines pruning functions called at step begin/end, before/after optimize and epoch begin/end. 2. Defines the pruning criterion. 3. Obtain block masks and its grads.
- Parameters:
modules – A dict {“module_name”: Tensor} that stores the pruning modules’ weights.
config – A config dict object that contains the pruner information.