Pytorch笔记【1】–导入Pytorch及判断torch基本的属性
Pytorch笔记目录:点位进入
在导入pytorch的时候时常需要判断一些基本的属性,最基本的有如下几种
- 导入Pytorch:
import torch
- 判断torch的版本:
torch.__version__
- 判断cuda是否可以使用:
torch.cuda.is_available()
- 判断gpu的熟练:
torch.cuda.device_count()
Pytorch笔记目录:点位进入
在导入pytorch的时候时常需要判断一些基本的属性,最基本的有如下几种
import torch
torch.__version__
torch.cuda.is_available()
torch.cuda.device_count()