neural_compressor.compression.pruner.pruners.pattern_lock

Pattern lock pruner.

Module Contents

Classes

PytorchPatternLockPruner

Pruning Pruner.

class neural_compressor.compression.pruner.pruners.pattern_lock.PytorchPatternLockPruner(config, modules)[source]

Pruning Pruner.

A Pruner class derived from BasePruner. In this pruner, original model’s sparsity pattern will be fixed while training. This pruner is useful when a user trains a sparse model without changing its original structure.

Parameters:
  • modules – A dict {“module_name”: Tensor} that stores the pruning modules’ weights.

  • config – A config dict object that contains the pruner information.

Inherit from parent class Pruner.