torch.cuda.memory.reset_peak_memory_stats#
- torch.cuda.memory.reset_peak_memory_stats(device=None)[source]#
重置 CUDA 内存分配器跟踪的“峰值”统计信息。
有关详细信息,请参阅
memory_stats()
。峰值统计信息对应于每个单独统计字典中的 “peak” 键。- 参数
device (torch.device or int, optional) – 选定的设备。如果
device
为None
(默认值),则返回当前设备(由current_device()
指定)的统计信息。
注意
有关 GPU 内存管理的更多详细信息,请参阅 内存管理。