📜  获取 cuda 内存 pytorch - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:11.685000             🧑  作者: Mango

代码示例1
t = torch.cuda.get_device_properties(0).total_memory
r = torch.cuda.memory_reserved(0)
a = torch.cuda.memory_allocated(0)
f = r-a  # free inside reserved