neural_compressor.pruner.pruner_legacy.magnitude
¶
Magnitude pruner.
Module Contents¶
Classes¶
Magnitude pruner class. |
- class neural_compressor.pruner.pruner_legacy.magnitude.BasicMagnitudePruner(model, local_config, global_config)¶
Bases:
neural_compressor.pruner.pruner_legacy.pruner.Pruner
Magnitude pruner class.
- Parameters:
- on_epoch_begin(epoch)¶
Update target sparsity according to the schedule and compute mask accordingly.
- on_step_begin(batch_id)¶
Apply mask to the weight.
- compute_mask()¶
Compute masks according to absolute values.
- on_epoch_end()¶
Sparsity ratio summary and apply mask to the weight.
- on_step_end()¶
Apply mask to the weight.