深度学习与PyTorch入门实战 - 06. 基本数据类型主讲人:龙良曲 ## All is about Tensor |python|PyTorch| |---|---| |Int|IntTensor of size()| |float|FloatTensor of size()| |Int array|IntTensor of size \[d1, d2, ...]| |Float array|FloatTensor of size \[d1, d2 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|0 码力 | 16 页 | 1.09 MB | 2 年前3
深度学习与PyTorch入门实战 - 07. 创建Tensor- Torch.FloatTensor(d1, d2, d3) NOT torch.FloatTensor([1, 2]) = torch.tensor([1, 2]) • Torch.IntTensor(d1, d2, d3) ## uninitialized 1 In [70]: torch.empty(1) 2 Out $$ 70 $$ : tensor $$ 0. $$ 4 In In [71]: torch.Tensor(2,3) 6 tensor([[ 3.1921e+27, 0.0000e+00, -1.0163e+11], 9 In [72]: torch.IntTensor(2,3) 10 Out $$ 72 $$ : 11 tensor([[ 1831143156, 12 [ 508, 0, -776122816], 0, -2147483648]]0 码力 | 16 页 | 1.43 MB | 2 年前3
共 2 条
- 1













