Shortcuts

MemPoolContext

class torch.cuda.MemPoolContext(*args, **kwargs)[source]

MemPoolContext holds the currently active pool and stashes the previous pool. On deletion it makes the previous pool active.

Parameters
  • pool (torch.cuda.MemPool) – a MemPool object to be made active so that

  • pool. (allocations route to this) –

static active_pool()[source]

Returns the active MemPool

Return type

Optional[_MemPool]

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources