code: def _compute_nparams_toprune(amount, tensor_size):
      r"""Convert the pruning amount from a percentage to absolute value.
  
      Since amount can be expressed either in absolute value or as a
      percentage of the number of units/channels in a tensor, this utility
      function converts the percentage to absolute value to standardize
      the handling of pruning.
  
      Args:
          amount (int or float): quantity of parameters to prune.
              If float, should be between 0.0 and 1.0 and represent the
              fraction of parameters to prune. If int, it represents the
              absolute number of parameters to prune.
          tensor_size (int): absolute number of parameters in the tensor
              to prune.
  
      Returns:
          int: the number of units to prune in the tensor
      """
      # incorrect type already checked in _validate_pruning_amount_init
      if isinstance(amount, numbers.Integral):
          return amount
      else:
          return round(amount * tensor_size)
  
imports: import numbers
  from abc import ABC, abstractmethod
  from collections.abc import Iterable
  from typing import Tuple
  import torch
label_desc: Use image node_id 13 for calling a global function with example usage: _compute_nparams_toprune(amount, tensor_size) and returns: amount, round