torch.accelerator.memory.max_memory_allocated#
- torch.accelerator.memory.max_memory_allocated(device_index=None,/)[source]#
Return the currentaccelerator maximum device memory occupied by tensorsin bytes for a given device index.
By default, this returns the peak allocated memory since the beginning ofthis program.
reset_peak_memory_stats()can be used toreset the starting point in tracking this metric.- Parameters
device_index (
torch.device, str, int, optional) – the index of the device to target.If not given, usetorch.accelerator.current_device_index()by default.If atorch.deviceor str is provided, its type must match the currentaccelerator device type.- Return type