32-bit floating point | torch.float32 ?or?torch.float | torch.FloatTensor | torch.cuda.FloatTensor |
64-bit floating point | torch.float64 ?or?torch.double | torch.DoubleTensor | torch.cuda.DoubleTensor |
16-bit floating point?1 | torch.float16 ?or?torch.half | torch.HalfTensor | torch.cuda.HalfTensor |
16-bit floating point?2 | torch.bfloat16 | torch.BFloat16Tensor | torch.cuda.BFloat16Tensor |
32-bit complex | torch.complex32 | | |
64-bit complex | torch.complex64 | | |
128-bit complex | torch.complex128 ?or?torch.cdouble | | |
8-bit integer (unsigned) | torch.uint8 | torch.ByteTensor | torch.cuda.ByteTensor |
8-bit integer (signed) | torch.int8 | torch.CharTensor | torch.cuda.CharTensor |
16-bit integer (signed) | torch.int16 ?or?torch.short | torch.ShortTensor | torch.cuda.ShortTensor |
32-bit integer (signed) | torch.int32 ?or?torch.int | torch.IntTensor | torch.cuda.IntTensor |
64-bit integer (signed) | torch.int64 ?or?torch.long | torch.LongTensor | torch.cuda.LongTensor |
Boolean | torch.bool | torch.BoolTensor | torch.cuda.BoolTensor |
quantized 8-bit integer (unsigned) | torch.quint8 | torch.ByteTensor | / |
quantized 8-bit integer (signed) | torch.qint8 | torch.CharTensor | / |
quantized 32-bit integer (signed) | torch.qfint32 | torch.IntTensor | / |
quantized 4-bit integer (unsigned)?3 | torch.quint4x2 | torch.ByteTensor | |