内存池
- classtorch.cuda.MemPool(*args, **kwargs)[源代码]
-
MemPool 表示缓存分配器中的一个内存池。当前,它仅保存 CUDACachingAllocator 中池对象的 ID。
- 参数
-
allocator (torch._C._cuda_CUDAAllocator, 可选) – 一个用于定义池中内存分配方式的 torch._C._cuda_CUDAAllocator 对象。如果
allocator
是None
(默认值),则内存分配将遵循 CUDACachingAllocator 的默认或当前配置。
- propertyallocator:Optional[_cuda_CUDAAllocator]
-
返回此MemPool分配的分配器