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 記憶體管理的更多詳細資訊,請參閱 記憶體管理。