torch.cuda.mem_get_info¶ torch.cuda.mem_get_info(device=None)[源代码]¶ 使用cudaMemGetInfo返回给定设备的全球空闲和总GPU内存。 Parameters 设备 (torch.device 或 int, 可选) – 选择的设备。返回当前设备的统计信息,由 current_device() 给出,如果 device 为 None(默认)。 Return type 元组[int, int] 注意 有关GPU内存管理的更多详细信息,请参阅内存管理。