latest (dev)
Copy
Latest development documentation · Updated 2026-10-08
tensorplay.ao.pruning.is_pruned
- tensorplay.ao.pruning.is_pruned(module: Module) bool[source]
Check whether
modulecarries an active pruning reparameterization.Scans every submodule for forward pre-hooks that are instances of
BasePruningMethod.- Parameters:
module – module that is either pruned or unpruned.
- Returns:
Truewhen at least one submodule is pruned,Falseotherwise.
Examples
>>> # xdoctest: +SKIP >>> m = nn.Linear(5, 7) >>> print(is_pruned(m)) False >>> random_unstructured(m, name="weight", amount=0.2) >>> print(is_pruned(m)) True
Help improve this page
Found an error, an unclear step, or a missing example?
Was this page helpful?

