code: def get_gpu_memory_from_ipex(
      device: int = 0, digits=2
  ) -> Tuple[float, float, float]:  # pragma: no cover
      r"""Returns the XPU memory statistics.
  
      Args:
          device (int, optional): The GPU device identifier. (default: :obj:`0`)
          digits (int): The number of decimals to use for megabytes.
              (default: :obj:`2`)
      """
      import intel_extension_for_pytorch as ipex
  
      stats = ipex.xpu.memory_stats_as_nested_dict(device)
      max_allocated = stats["allocated_bytes"]["all"]["peak"]
      max_reserved = stats["reserved_bytes"]["all"]["peak"]
      max_active = stats["active_bytes"]["all"]["peak"]
      max_allocated = byte_to_megabyte(max_allocated, digits)
      max_reserved = byte_to_megabyte(max_reserved, digits)
      max_active = byte_to_megabyte(max_active, digits)
      ipex.xpu.reset_peak_memory_stats(device)
      return max_allocated, max_reserved, max_active
  
imports: import gc
  import os
  import os.path
  import random
  import subprocess
  import sys
  import warnings
  from collections.abc import Mapping, Sequence
  from typing import Any, Tuple
  import torch
  from torch import Tensor
  from torch_geometric.data.data import BaseData
  from torch_geometric.typing import SparseTensor
label_desc: Use image node_id 7 for calling a global function with example usage: get_gpu_memory_from_ipex(device, digits) and returns: max_allocated,  max_reserved,  max_active