评价此页

torch.accelerator.memory.reset_accumulated_memory_stats#

torch.accelerator.memory.reset_accumulated_memory_stats(device_index=None, /)[源代码]#

重置指定设备索引的当前 accelerator 内存分配器跟踪的“累积”(历史)统计信息。

参数

device_index (torch.device, str, int, optional) – 要定位的设备索引。如果未给出,则默认使用 torch.accelerator.current_device_index()。如果提供了 torch.device 或 str,则其类型必须与当前的 accelerator 设备类型匹配。

注意

如果当前 accelerator 的内存分配器尚未初始化,则此函数将不执行任何操作。