torch.accelerator.memory.memory_reserved#
- torch.accelerator.memory.memory_reserved(device_index=None, /)[原始碼]#
返回給定裝置索引下,由快取分配器管理的當前 加速器 裝置記憶體(以位元組為單位)。
- 引數
device_index (
torch.device, str, int, optional) – 要定位的裝置索引。如果未給出,則預設使用torch.accelerator.current_device_index()。如果提供了torch.device或 str,則其型別必須與當前的 accelerator 裝置型別匹配。- 返回型別