code: def _save_segment_usage(filename="output.svg", snapshot=None):
      if snapshot is None:
          snapshot = _snapshot()
      with open(filename, "w") as f:
          f.write(_segments(snapshot))
  
imports: import collections
  import contextlib
  import ctypes
  import pickle
  import sys
  import warnings
  from inspect import signature
  from typing import Any, Dict, Optional, Tuple, Union
  import torch
  from torch import _C
  from torch.types import Device
  from .None import _get_device_index, _get_nvml_device_index, _lazy_init, is_initialized
  from ._memory_viz import memory, segments
  from ._utils import _dummy_type
label_desc: Use image node_id 28 for calling a global function with example usage: _save_segment_usage(filename, snapshot) without return types