Rate this Page

torch.accelerator.memory.memory_reserved#

torch.accelerator.memory.memory_reserved(device_index=None,/)[source]#

Return the currentaccelerator device memory managed by the caching allocatorin bytes for a given device index.

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.device or str is provided, its type must match the currentaccelerator device type.

Return type

int