In [1]: import numpy as np
In [2]: A = np.array([[1,2,3],[1,2,3]]);
In [3]: B1 = np.array([3,2,1]);
In [4]: B2 = np.array([[3,2,1]]);
In [5]: A*B1
Out[5]:
array([[3,4,3],[3,4,3]])
In [6]: A*B2
Out[6]:
array([[3,4,3],[3,4,3]])#←why 2d?
'''
A*B1 = [[1,2,3],[1,2,3]]*[3,2,1]
= [[1,2,3]*[3,2,1],[1,2,3]*[3,2,1]]
= [[3,4,3],[3,4,3]]
A*B2 = [[1,2,3],[1,2,3]]*[[3,2,1]]
= [ [1,2,3]*[[3,2,1]],[1,2,3]*[[3,2,1]] ]
= [ [[1,2,3]*[3,2,1]],[[1,2,3]*[3,2,1]] ]
= [ [[3,4,3]],[[3,4,3]] ]←why 3d?
'''