在遇到这个代码时,大多数情况下就是两个运算的向量维度不匹配,此时,可以打印一下两个数组的维度,
# print(“[DEBUG] a shape:”, a.shape)
# print(“[DEBUG]b:”, b.shape)
假设a.shape结果为[,200],b.shape结果为[210,255],那么此时就会报这个错误
ValueError: matmul: Input operand 1 has a mismatch in its core dimension 0, with gufunc signature (n?,k),(k,m?)->(n?,m?) (size 210 is different from 200)
这时候可以通过设置def a_correction(a): return a[:200] # 截断前200个特征