code: def count_params(weights):
      """Count the total number of scalars composing the weights.
  
      Args:
          weights: An iterable containing the weights on which to compute params
  
      Returns:
          The total number of scalars composing the weights
      """
      unique_weights = {id(w): w for w in weights}.values()
      weight_shapes = [w.shape.as_list() for w in unique_weights]
      standardized_weight_shapes = [
          [0 if w_i is None else w_i for w_i in w]
          for w in weight_shapes
      ]
      return int(sum(np.prod(p) for p in standardized_weight_shapes))
  
file_path: tensorflow-upstream/tensorflow/python/keras/utils/layer_utils.py
imports: import functools
  import weakref
  import numpy
  from tensorflow.python.util import nest
label_desc: Use image node_id 3 for calling a global function with example usage: count_params(weights) and returns: int