code: def empty_gpu(device):
      """Empty GPU or MPS memory and run garbage collector."""
      gc.collect()
      device = str(device)
      if "cuda" in device.lower():
          torch.cuda.empty_cache()
      elif "mps" in device.lower():
          try:
              from torch import (
                  mps,
              )  # pylint: disable=import-outside-toplevel
  
              mps.empty_cache()
          except Exception:  # pylint: disable=broad-except
              pass
  
label_desc: Use image node_id 1 for calling a global function with example usage: empty_gpu(device) without return types