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