Java教程

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

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

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

这篇关于ValueError: shapes (3,3) and (0,) not aligned: 3 (dim 1)的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!