torch.cuda.reset_max_memory_cached¶
- torch.cuda.reset_max_memory_cached(device=None)[source][source]¶
重置给定设备上由缓存分配器管理的 GPU 最大内存跟踪的起始点。
有关详细信息,请参阅
max_memory_cached()
。- 参数
device (torch.device 或 int, 可选) – 选定的设备。如果
device
为None
(默认值),则返回由current_device()
给出的当前设备的统计信息。
警告
此函数现在会调用
reset_peak_memory_stats()
,该函数会重置 /所有/ 峰值内存统计信息。注意
有关 GPU 内存管理的更多详细信息,请参阅 内存管理。