栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

PyTorch基础资料库(1):数据类型的定义方式

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

PyTorch基础资料库(1):数据类型的定义方式

在PyTorch中,一些数据类型需要掌握,那么如何才能够自定义数据类型。接下来就是一些参考。

数据类型

dtype

CPU张量

GPU张量

32位浮点数(float)

torch.float32 or torch.float

torch.FloatTensor

torch.cuda.FloatTensor

64位浮点数(double)

torch.float64 or torch.double

torch.DoubleTensor

torch.cuda.DoubleTensor

16位浮点数(half)

torch.float16 or torch.half

torch.HalfTensor

torch.cuda.HalfTensor

16位浮点数(bfloat16)

torch.bfloat16

torch.BFloat16Tensor

torch.cuda.BFloat16Tensor

32位复合型

torch.complex32

64位复合型

torch.complex64

128位复合型

torch.complex128 or torch.cdouble

8-bit integer (unsigned)

torch.uint8

torch.ByteTensor

torch.cuda.ByteTensor

8带符号位整型(int8)

torch.int8

torch.CharTensor

torch.cuda.CharTensor

16位带符号整型 (short)

torch.int16 or torch.short

torch.ShortTensor

torch.cuda.ShortTensor

32位带符号整型 (int)

torch.int32 or torch.int

torch.IntTensor

torch.cuda.IntTensor

64位带符号整型 (long)

torch.int64 or torch.long

torch.LongTensor

torch.cuda.LongTensor

布尔逻辑

torch.bool

torch.BoolTensor

torch.cuda.BoolTensor

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/304034.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号