neural_compressor.compression.pruner.tf_criteria
Tensorflow pruning criterion.
Classes
Pruning base criterion. |
|
Pruning criterion. |
Functions
|
Register a criterion to the registry. |
|
Get registered criterion class. |
Module Contents
- neural_compressor.compression.pruner.tf_criteria.register_criterion(name)[source]
Register a criterion to the registry.
- neural_compressor.compression.pruner.tf_criteria.get_tf_criterion(config, modules)[source]
Get registered criterion class.
- class neural_compressor.compression.pruner.tf_criteria.PruningCriterion(modules, config)[source]
Pruning base criterion.
- Parameters:
config – A config dict object that includes information about pruner and pruning criterion.
modules – A dict {“module_name”: Tensor} that stores the pruning modules’ weights.
- class neural_compressor.compression.pruner.tf_criteria.MagnitudeCriterion(modules, config)[source]
Pruning criterion.
The magnitude criterion_class is derived from PruningCriterion. The magnitude value is used to score and determine if a weight is to be pruned.
- Parameters:
config – A config dict object that includes information about pruner and pruning criterion.
modules – A dict {“module_name”: Tensor} that stores the pruning modules’ weights.