If you start with:
a = np.array([[1,2,3,4],[5,6,7,8]])
b = np.array([[1,0,0],[0,1,0],[0,0,1],[1,1,1]])
Then we can add an additional axis to a, and repeating the array along it gives us ...
>>> a[:,:,None].repeat(3, axis=2)
array([[[1, 1, 1],
[2, 2, 2],
[3, 3, 3],
[4, 4, 4]],
[[5, 5, 5],
[6, 6, 6],
[7, 7, 7],
[8, 8, 8]]])
Now, as @Jaime says, there is no need to use it repeatwhile you work, because NumPy broadcast will take care of this:
>>> a[:,:,None] * b
array([[[1, 0, 0],
[0, 2, 0],
[0, 0, 3],
[4, 4, 4]],
[[5, 0, 0],
[0, 6, 0],
[0, 0, 7],
[8, 8, 8]]])