评价此页

torch.mps.current_allocated_memory#

torch.mps.current_allocated_memory()[源代码]#

以字节为单位返回当前由张量占用的 GPU 内存。

注意

返回的大小不包括 MPSAllocator 内存池中的缓存分配。

返回类型

int