版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/a19990412/article/details/83986892
>>> import torch
>>> a = torch.ones([1,2])
>>> b = torch.ones([1,2])
>>> torch.cat([a,b],1)
tensor([[1., 1., 1., 1.]])
>>> a
tensor([[1., 1.]])
>>> b
tensor([[1., 1.]])
>>> torch.cat([a,b],0)
tensor([[1., 1.],
[1., 1.]])
学习了下面链接
https://blog.csdn.net/guotong1988/article/details/78717665