pytorch中关于cuda的的一些常用函数
- torch.cuda.is_available()
作用查看GPU是否可用
- torch.cuda.device_count()
返回GPU的数量
- torch.cuda.get_device_name()
获取GPU的名字
- torch.cuda.memory_allocated()
返回当前tensor占用的显卡大小
- torch.cuda.max_memory_allocated()
返回GPU中tensor峰值分配内存
pytorch中关于cuda的的一些常用函数
作用查看GPU是否可用
返回GPU的数量
获取GPU的名字
返回当前tensor占用的显卡大小
返回GPU中tensor峰值分配内存