"Now, B is a matrix, slices of B will be matrices themselves, and your multiplication will work as expected." . . . . .