Pytorch.cat()实例

版权声明:本文为博主原创文章,未经博主允许不得转载。 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

猜你喜欢

转载自blog.csdn.net/a19990412/article/details/83986892
cat