Shortcuts

MemPool

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

MemPool represents a pool of memory in a caching allocator. Currently, it’s just the ID of the pool object maintained in the CUDACachingAllocator.

Parameters

allocator (torch._C._cuda_CUDAAllocator, optional) – a torch._C._cuda_CUDAAllocator object that can be used to define how memory gets allocated in the pool. If allocator is None (default), memory allocation follows the default/ current configuration of the CUDACachingAllocator.

property allocator: Optional[_cuda_CUDAAllocator]

Returns the allocator this MemPool routes allocations to

property id: Tuple[int, int]

Returns the ID of this pool as a tuple of two ints.

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