torch.cuda.memory.reset_accumulated_memory_stats#
- torch.cuda.memory.reset_accumulated_memory_stats(device=None)[source]#
重置 CUDA 記憶體分配器跟蹤的“累積”(歷史)統計資訊。
有關詳細資訊,請參閱
memory_stats()。累積統計資訊對應於每個單獨統計資訊字典中的 “allocated” 和 “freed” 鍵,以及 “num_alloc_retries” 和 “num_ooms”。- 引數
device (torch.device 或 int, 可選) – 選擇的裝置。如果
device為None(預設),則返回當前裝置(由current_device()指定)的統計資訊。
注意
有關 GPU 記憶體管理的更多詳細資訊,請參閱 記憶體管理。