torch.mps.current_allocated_memory

torch.mps.current_allocated_memory() [source]

Returns the current GPU memory occupied by tensors in bytes.

Note

The returned size does not include cached allocations in memory pools of MPSAllocator.

Return type

int

© 2024, PyTorch Contributors
PyTorch has a BSD-style license, as found in the LICENSE file.
https://pytorch.org/docs/2.1/generated/torch.mps.current_allocated_memory.html