Shortcuts

torch.cuda.memory_reserved

torch.cuda.memory_reserved(device=None)[源代码]

返回由缓存分配器管理的指定设备的当前GPU内存,单位为字节。

Parameters

设备 (torch.deviceint, 可选) – 选择的设备。返回当前设备的统计信息,由 current_device() 给出,如果 deviceNone(默认)。

Return type

int

注意

有关GPU内存管理的更多详细信息,请参阅内存管理