torch.cuda.get_allocator_backend¶ torch.cuda.get_allocator_backend()[source][source]¶ 返回一個字串,描述由 PYTORCH_CUDA_ALLOC_CONF 設定的活動分配器後端。當前可用的後端有 native (PyTorch 的原生快取分配器) 和 cudaMallocAsync` (CUDA 的內建非同步分配器)。 注意 有關選擇分配器後端的詳細資訊,請參閱 記憶體管理。 返回型別 str