Represents a pruned module returned by pytorch_nndct.Pruner.prune()
.
Attributes
- module
- A
torch.nn.Module
that represents the actual pruned module. - pruning_info
- A dictionary containing pruning details of each layer.
Methods
save(path)
Saves sparse state to given path.
- path
- Checkpoint path to save.
state_dict(destination=None, prefix='', keep_vars=False)
Returns a dictionary containing a whole state of the module. Refer to related Pytorch Document
padded_state_dict()
Returns a dictionary containing a sparse state of the module. The shape of the state is the same as the original baseline model with the pruned channels filled with zeros.