问题相关代码
print(link_od)
print(link_od.shape)
print(etaODAVG)
print(etaODAVG.shape)
x_lstm = torch.cat([x_link_od,
etaODAVG],
-1)
print(x_lstm)
运行结果及报错内容
tensor([[187975, 55639],
[ 82492, 25441],
[ 82492, 25441]])
torch.Size([3, 2])
tensor([[-0.4727],
[-0.2943],
[-0.2943]])
torch.Size([3, 1])
RuntimeError: Tensors must have same number of dimensions: got 3 and 2
我想要达到的结果
请问怎样才能让torch.cat成功运行,将第二个tensor按行拼接到第一个tensor后面。