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