其他分享
首页 > 其他分享> > ValueError: shapes (3,3) and (0,) not aligned: 3 (dim 1)

ValueError: shapes (3,3) and (0,) not aligned: 3 (dim 1)

作者:互联网

ValueError: shapes (3,3) and (0,) not aligned: 3 (dim 1) != 0 (dim 0)

参考:https://stackoverflow.com/questions/39608421/showing-valueerror-shapes-1-3-and-1-3-not-aligned-3-dim-1-1-dim-0

The column of the first matrix and the row of the second matrix should be equal and the order should be like this only

column of first matrix = row of second matrix
and do not follow the below step

row of first matrix  = column of second matrix
it will throw an error

发现两个矩阵乘的时候有个是空的

在这里插入图片描述
忘记返回了
在这里插入图片描述
记得返回值
在这里插入图片描述

标签:dim,matrix,column,shapes,second,aligned,row
来源: https://blog.csdn.net/qq_21237549/article/details/121917175