code: def _get_dfs_module_list(
      module: nn.Module,
      memo: Optional[Set[nn.Module]] = None,
      prefix: str = "",
  ):
      """Get a dfs module list of the given module. Its order is same as the order of creations of modules."""
      if memo is None:
          memo = set()
      if module not in memo:
          for name, submodule in module._modules.items():
              if submodule is None:
                  continue
              submodule_prefix = prefix + ("." if prefix else "") + name
              for m in _get_dfs_module_list(
                  submodule, memo, submodule_prefix
              ):
                  yield m
  
          memo.add(module)
          yield prefix, module
  
file_path: ColossalAI/colossalai/zero/gemini/utils.py
imports: from collections import OrderedDict
  from copy import copy
  from typing import Optional, Set
  import torch
  import torch.distributed
  import torch.nn
  from colossalai.utils import get_current_device
  from .chunk import Chunk
label_desc: Use image node_id 2 for calling a global function with example usage: _get_dfs_module_list(module, memo, prefix) without return types