Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我面临将三个张量连接在一起,以便 3 px1 张量成为一个 3px1 张量。
我能想到的最简洁的是:
torch.Tensor{v2:totable(),v4:totable(),v6:totable()}:view(3*p,1)
有没有办法在不转换为表格并返回张量的情况下做到这一点?假设它们具有兼容的形状,似乎应该有一种通用的方法来沿某个指定的维度连接张量。
我可以看到如何编写这样的函数,不存在吗?
a = torch.randn(3,1) b = torch.randn(3,1) c = torch.randn(3,1) d = torch.cat(a,b,1):cat(c,1) print(d)