latest (dev)
Copy
Latest development documentation · Updated 2026-10-08
tensorplay.ao.pruning.compute_nparams_to_prune
- tensorplay.ao.pruning.compute_nparams_to_prune(amount: int | float, tensor_size: int) int[source]
Convert a pruning amount into an absolute unit count.
An integer
amountis returned unchanged; a floatamountis read as a fraction oftensor_sizeand rounded to the nearest integer.- Parameters:
amount – pruning quantity (absolute int, or fractional float in
[0, 1]).tensor_size – number of units available for pruning.
- Returns:
The number of units to prune.
Help improve this page
Found an error, an unclear step, or a missing example?
Was this page helpful?

