code: def max_memory_cached(device: Union[Device, int] = None) -> int:
      r"""Deprecated; see :func:`~torch.cuda.max_memory_reserved`."""
      warnings.warn(
          "torch.cuda.max_memory_cached has been renamed to torch.cuda.max_memory_reserved",
          FutureWarning,
      )
      return max_memory_reserved(device=device)
  
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 18 for calling a global function with example usage: max_memory_cached(device) and returns: max_memory_reserved