torch.cuda.memory.reset_max_memory_allocated#
- torch.cuda.memory.reset_max_memory_allocated(device=None)[source]#
重置给定设备的张量最大 GPU 内存跟踪的起点。
有关详细信息,请参阅
max_memory_allocated()
。- 参数
device (torch.device 或 int, optional) – 选定的设备。如果
device
为None
(默认),则返回当前设备的统计信息,由current_device()
提供。
警告
此函数现在调用
reset_peak_memory_stats()
,它将重置 /所有/ 峰值内存统计信息。注意
有关 GPU 内存管理的更多详细信息,请参阅 内存管理。