torch.xpu.memory_usage
- torch.xpu.memory_usage(device=None)
Return the GPU memory bandwidth usage as a percentage.
The value is computed by dividing the byte-transfer delta by the time delta between two bandwidth-counter reads separated by a 100ms sampling interval, then normalizing by the peak bandwidth reported by the hardware.
- Parameters:
device (torch.device) – selected device. Uses the current device, given by , if (default).