torch.cuda.memory_reserved

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

以字节为单位返回缓存分配器管理的给定设备上的当前GPU内存。

参数

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

返回类型

int

注意

关于GPU内存管理的更多信息,请参见内存管理

本页目录