code: def count_parameters_in_param_groups(
      pg: List[Dict[str, List[torch.nn.Parameter]]]
  ) -> Dict[str, int]:
      kv_iter = enumerate(pg)
      dict_iter = [
          (str(key), sum([p.numel() for p in value["params"]]))
          for key, value in kv_iter
      ]
      return dict(dict_iter)
  
file_path: pytorch-toolbelt/tests/test_optimizer.py
imports: import collections
  from typing import List, Dict
  import torch.nn
  from torch import nn
  from torch.optim import SGD
  from pytorch_toolbelt.optimization.functional import build_optimizer_param_groups
  from pytorch_toolbelt.utils import count_parameters
label_desc: Use image node_id 1 for calling a global function with example usage: count_parameters_in_param_groups(pg) and returns: dict