TensorPlay
latest (dev)
Copy
View Markdown

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 amount is returned unchanged; a float amount is read as a fraction of tensor_size and 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.

On this page

Ask DeepWiki