matrixADimensions = matrixA.shape # returns [901,1249,1]
matrixBDimensions = matrixB.shape # returns [901,1249]
I am trying to get the element-wise multiplication of matrixA and matrixB but I am getting the error ValueError: operands could not be broadcast together with shapes (901,1249,1) (901,1249)
.
I believe it has something to do with the dimensions of both matrices since they are not the same. Actually, technically they are the same since [901,1249,1]
is the same thing as [901,1249]
but Python does not seem to know this.
How can I multiply matrixA with matrixB?