MemPool#
- class torch.xpu.memory.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 XPUCachingAllocator.
- Parameters:
allocator (torch._C._xpu_XPUAllocator, optional) – a torch._C._xpu_XPUAllocator object that can be used to define how memory gets allocated in the pool. If
allocatorisNone(default), memory allocation follows the default/ current configuration of the XPUCachingAllocator.use_on_oom (bool, optional) – a bool that indicates if this pool may be used as a last resort when an allocation outside the pool fails with OOM. Defaults to
False.no_split (bool, optional) – if
True, cached segments in this pool are never split to serve smaller allocations. Defaults toFalse.