RuntimeError: dimension out of range (expected to be in range of [-1, 0], but got 1) 变量形状问题
在Pytorch中,我想通过点乘操作得到S:
// 点乘操作
S=a.mm(b)
运行代码时,老是报错:
RuntimeError: dimension out of range (expected to be in range of [-1, 0], but got 1)
输出a和b的维度发现: a的形状为 [20 , 5], 但是b的形状为[5 , ]。考虑用pytorch中...
原创
2019-04-11 22:17:31 ·
29369 阅读 ·
0 评论