pytorch是否可以使用CUDA
发布日期:2021-07-01 02:26:33 浏览次数:2 分类:技术文章

本文共 277 字,大约阅读时间需要 1 分钟。

import torch# 返回当前设备索引print(torch.cuda.current_device())# 返回GPU的数量print(torch.cuda.device_count())# 返回gpu名字,设备索引默认从0开始print(torch.cuda.get_device_name(0))# cuda是否可用print(torch.cuda.is_available())# cuda当前的版本print(torch.version.cuda)# 测试程序a = torch.Tensor(5,3)a=a.cuda()print(a)

转载地址:https://mapengsen.blog.csdn.net/article/details/117842466 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:pycharm引入其他目录的包报错,import报错
下一篇:CUDA11.1安装教程

发表评论

最新留言

很好
[***.229.124.182]2024年05月02日 04时44分39秒