文章目录
- stack
- d = t.stack((a,), dim=0)
- d = t.stack((a,), dim=1)
- d = t.stack((a,), dim=2)
- d = t.stack((a,b), dim=0)
- d = t.stack((a,b), dim=1)
- d = t.stack((a,b), dim=2)
- d = t.stack((a,b,c), dim=0)
- d = t.stack((a,b,c), dim=1)![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/17e5d3fb880059c1367a890bc4a1ae7d.png)
- d = t.stack((a,b,c), dim=2)
stack
import torch as t
a = t.arange(1, 10).reshape(3, 3)
a
b = t.arange(10, 100, 10).reshape(3, 3)
b
c = t.arange(100, 1000, 100).reshape(3, 3)
c
d = t.stack((a,), dim=0)