code: def _calc_number_of_params(model: List[torch.nn.Module]) -> int:
      assert isinstance(model, list)
      return sum(
          [
              sum([p.nelement() for p in model_module.parameters()])
              for model_module in model
          ]
      )
  
imports: from typing import Any, Callable, Dict, List, Optional
  import torch
  from nemo.collections.nlp.modules.common.megatron.utils import ApexGuardDefaults
  from nemo.utils import logging
label_desc: Use image node_id 2 for calling a global function with example usage: _calc_number_of_params(model) and returns: sum