当前位置:   article > 正文

pytorch中tensor的类型_pytorch tensor类型

pytorch tensor类型

Torch定义了七种CPU tensor类型和八种GPU tensor类型:

CPU tensor
32-bit floating point: torch.FloatTensor
64-bit floating point: torch.DoubleTensor
8-bit integer (unsigned): torch.ByteTensor
8-bit integer (signed): torch.CharTensor
16-bit integer (signed) : torch.ShortTensor
32-bit integer (signed) : torch.IntTensor
64-bit integer (signed) : torch.LongTensor

GPU tensor
32-bit floating point: torch.cuda.FloatTensor
64-bit floating point: torch.cuda.DoubleTensor
16-bit floating point: torch.cuda.HalfTensor
8-bit integer (unsigned): torch.cuda.ByteTensor
8-bit integer (signed): torch.cuda.CharTensor
16-bit integer (signed) : torch.cuda.ShortTensor
32-bit integer (signed) : torch.cuda.IntTensor
64-bit integer (signed) : torch.cuda.LongTensor

torch.Tensor是默认类型torch.FloatTensor

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/AllinToyou/article/detail/272481
推荐阅读
相关标签
  

闽ICP备14008679号