RuntimeError:The size of tensor a (100) must match the size of tensor b (12800) at non-singleton di

RuntimeError:The size of tensor a (100) must match the size of tensor b (12800) at non-singleton di_第1张图片

问题:维度不对应,一个第一维是1,另一个第一维是128

解决:往前追溯,发现问题根源,使用repeat将其改为128维:

 注意:这里要使用.size()将其改为128维,而不能直接写128,负责运行几轮后便会报错。

你可能感兴趣的:(代码运行ERROR,python)