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