See :ref:`cuda-memory-management` for more details about GPU memory
management.
return memory_stats(device=device)["reserved_bytes.all.peak"]
def memory_cached(device: Union[Device, int] = None) -> int:
rDeprecated; see :func:`~torch.cuda.memory_reserved`.
After Change
See :ref:`cuda-memory-management` for more details about GPU memory
management.
return memory_stats(device=device).get("reserved_bytes.all.peak", 0)
def memory_cached(device: Union[Device, int] = None) -> int:
rDeprecated; see :func:`~torch.cuda.memory_reserved`.