code: def has_moe_layers(m):
      has_moe = False
      num_experts = 0
  
      for _, module in m.named_modules():
          if isinstance(module, MoE):
              has_moe = True
              num_experts = module.num_experts
              break
      return has_moe, num_experts
  
file_path: deepspeed/deepspeed/moe/utils.py
imports: from typing import List, Tuple, Dict
  import torch
  from .layer import MoE
label_desc: Use image node_id 1 for calling a global function with example usage: has_moe_layers(m) and returns: has_moe,  num_experts