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