Rate this Page

torch.cuda.memory.memory_reserved#

torch.cuda.memory.memory_reserved(device=None)[source]#

Return the current GPU memory managed by the caching allocator in bytes for a given device.

Parameters

device (torch.device orint,optional) – selected device. Returnsstatistic for the current device, given bycurrent_device(),ifdevice isNone (default).

Return type

int

Note

SeeMemory management for more details about GPU memorymanagement.