MemPool¶
- class torch.cuda.MemPool(*args, **kwargs)[source][source]¶
MemPool 表示快取分配器中的一個記憶體池。目前,它只是 CUDACachingAllocator 中維護的記憶體池物件的 ID。
- 引數
allocator (torch._C._cuda_CUDAAllocator, 可選) – 一個 torch._C._cuda_CUDAAllocator 物件,可用於定義記憶體如何在池中分配。如果
allocator為None(預設),記憶體分配將遵循 CUDACachingAllocator 的預設/當前配置。