PyTorch 2 · Performance

Check GPU memory

Print how much GPU memory tensors use.

torch.cuda.memory_allocated() / 1e9

Official PyTorch 2 documentation

More performance commands

All performance commands · PyTorch 2 cheatsheet

Was this page helpful?