# tensorplay.ao.pruning.compute_nparams_to_prune Source: https://www.tensorplay.cn/docs/generated/tensorplay.ao.pruning.compute_nparams_to_prune.html ```python tensorplay.ao.pruning.compute_nparams_to_prune(amount: int | float, tensor_size: int) → int ``` 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.