我有一个简单的问题要解决
x = torch.randn(400, 400, 32)
y = torch.randn(400, 32, 32)
out=torch.add(x,y)
RuntimeError: The size of tensor a (400) must match the size of tensor b (32) at non-singleton dimension 1
我试着
y=y.repeat(1, x.size(1),1)
但不起作用
我知道错误意味着我试图添加的维度不正确。然而,我很难重塑这些张量,使其具有相同的维数
求你了,我需要你的帮助
目前没有回答
相关问题 更多 >
编程相关推荐