code: def print_process_memory(
      p: psutil.Process, logger: Optional[MMLogger] = None
  ) -> None:
      """print process memory info."""
      mem_used = gb_round(psutil.virtual_memory().used)
      memory_full_info = p.memory_full_info()
      uss_mem = gb_round(memory_full_info.uss)
      if hasattr(memory_full_info, "pss"):
          pss_mem = gb_round(memory_full_info.pss)
  
      for children in p.children():
          child_mem_info = children.memory_full_info()
          uss_mem += gb_round(child_mem_info.uss)
          if hasattr(child_mem_info, "pss"):
              pss_mem += gb_round(child_mem_info.pss)
  
      process_count = 1 + len(p.children())
  
      log_msg = f"(GB) mem_used: {mem_used:.2f} | uss: {uss_mem:.2f} | "
      if hasattr(memory_full_info, "pss"):
          log_msg += f"pss: {pss_mem:.2f} | "
      log_msg += f"total_proc: {process_count}"
      print_log(log_msg, logger)
  
imports: import copy
  import time
  from functools import partial
  from typing import List, Optional, Union
  import numpy
  import torch
  import torch.nn
  from mmcv.cnn import fuse_conv_bn
  from mmengine import MMLogger
  from mmengine.config import Config
  from mmengine.device import get_max_cuda_memory
  from mmengine.dist import get_world_size
  from mmengine.runner import Runner, load_checkpoint
  from mmengine.utils.dl_utils import set_multi_processing
  from torch.nn.parallel import DistributedDataParallel
  from mmdet.registry import DATASETS, MODELS
label_desc: Use image node_id 3 for calling a global function with example usage: print_process_memory(p, logger) without return types