A [torch.Tensor] is a multiple dimensional matrix containing elements of a single data type.
[torch.Tensor] is same as [torch.FloatTensor].
look at this table.
| Data type | dtype | CPU tensor | GPU tensor |
|---|---|---|---|
| 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 | torch.float16 or torch.half | torch.HalfTensor | torch.cuda.HalfTensor |
| 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 |
- <pytorch.org/docs/stable/tensors.html>
So, when we define a value as [torch.Tensor], it's a float type value.
[torch.LongTensor] is an int64 data type value.
[torch.Tensor] is a float32 data type value.
반응형
'IT > machine learning' 카테고리의 다른 글
| Use Tensorboard on Jupyter Notebook without CLI (0) | 2019.01.23 |
|---|---|
| tensorflow keras running error about initializers (0) | 2019.01.22 |
| Calculate Convolutional Layer Output size (0) | 2018.07.05 |
| gcp 에서 jupyter notebook 실행 (0) | 2018.02.23 |
| GCP에서 VM 생성후 putty로 접속하는 방법 (0) | 2018.02.23 |