code: def torch_mps_gc() -> None:
      try:
          if shared.state.current_latent is not None:
              log.debug(
                  "`current_latent` is set, skipping MPS garbage collection"
              )
              return
          from torch.mps import empty_cache
  
          empty_cache()
      except Exception:
          log.warning("MPS garbage collection failed", exc_info=True)
  
file_path: stable-diffusion-webui/modules/mac_specific.py
imports: import logging
  import torch
  from torch import Tensor
  import platform
  from modules.sd_hijack_utils import CondFunc
  from packaging import version
  from modules import shared
label_desc: Use image node_id 2 for calling a global function with example usage: torch_mps_gc() without return types