Pytorch笔记【1】--导入Pytorch及判断torch基本的属性

Pytorch笔记【1】–导入Pytorch及判断torch基本的属性

Pytorch笔记目录:点位进入

在导入pytorch的时候时常需要判断一些基本的属性,最基本的有如下几种

在这里插入图片描述

  • 导入Pytorch:import torch
  • 判断torch的版本:torch.__version__
  • 判断cuda是否可以使用:torch.cuda.is_available()
  • 判断gpu的熟练:torch.cuda.device_count()
原创文章 113 获赞 80 访问量 3万+

猜你喜欢

转载自blog.csdn.net/python_LC_nohtyp/article/details/105962550
今日推荐