评价此页

torch.xpu.memory.mem_get_info#

torch.xpu.memory.mem_get_info(device=None)[source]#

返回给定设备的全局空闲和总 GPU 内存。

参数

device (torch.device or int or str, optional) – 选定的设备。如果 deviceNone(默认值),则返回当前设备统计信息,由 current_device() 指定。

返回

设备上的可用内存(以字节为单位)。 int:设备上的总内存(以字节为单位)

返回类型

int