code: def get_modules(configs: BaseConfigs):
      """
      Get all the PyTorch modules in ``configs`` object.
  
      Arguments:
          configs (labml.configs.BaseConfigs): configurations object
      """
  
      keys = dir(configs)
  
      modules = {}
      for k in keys:
          type_ = configs._get_type(k)
          try:
              if issubclass(type_, torch.nn.Module):
                  modules[k] = getattr(configs, k)
          except TypeError:
              pass
  
      return modules
  
file_path: labml/client/labml/utils/pytorch.py
imports: from typing import Optional, Dict, TYPE_CHECKING
  import torch
  from labml import tracker
  from labml.configs import BaseConfigs
label_desc: Use image node_id 5 for calling a global function with example usage: get_modules(configs) and returns: modules