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, optional) – 选择的设备。如果
device
为None
(默认值),则返回当前设备 (current_device()
) 的统计信息。
注意
有关 GPU 内存管理的更多详细信息,请参阅 内存管理。