pytorch张量数据类型

看代码:
x = torch.Tensor(5,3)
print(x.type())
print(x.dtype)
输出:
torch.FloatTensor
torch.float32
可见张量的默认数据类型未float32
当然pytorch还支持:int, long,short,double,byte也就是uint8 ,至于其他类型:unsigned float,unsiged double,int8,unsigned short,unsigned int,unsiged long,long long暂时未找到方法

猜你喜欢

转载自blog.csdn.net/qq_33345917/article/details/86546877
今日推荐