pytorch基础
文章目录1.torch的range和arange2.torch.cat()
1.torch的range和arange
代码如下(示例):
>>> y=torch.range(1,6)
>>> y
tensor([1., 2., 3., 4., 5., 6.])
>>> y.dtype
torch.float32
>>> z=torch.arange(1,6)
>>> z
tensor([1, 2, 3, 4, 5]
原创
2022-02-22 23:35:28 ·
815 阅读 ·
0 评论