neural_compressor.compression.pruner.patterns.nxm
NxM patterns.
Classes
Pruning Pattern. |
|
Pruning Pattern. |
Module Contents
- class neural_compressor.compression.pruner.patterns.nxm.PytorchPatternNxM(config, modules)[source]
Pruning Pattern.
A Pattern class derived from BasePattern. In this pattern, the weights in a NxM block will be pruned or kept during one pruning step.
- Parameters:
config – A config dict object that contains the pattern information.
- Please note that the vertical direction of a Linear layer's weight refers to the output channel.
because PyTorch’s tensor matmul has a hidden transpose operation.
- class neural_compressor.compression.pruner.patterns.nxm.KerasPatternNxM(config, modules)[source]
Pruning Pattern.
A Pattern class derived from BasePattern. In this pattern, the weights in a NxM block will be pruned or kept during one pruning step.
- Parameters:
config – A config dict object that contains the pattern information.
- Please note that the vertical direction of a Linear layer's weight refers to the output channel.
because PyTorch’s tensor matmul has a hidden transpose operation.