Human: Numpy: Multiplying a matrix with a 3d tensor -- Suggestion Assistant: 
Here is some code to multiply a matrix `P` with a 3d tensor `T` in scipy

scipy.tensordot(P, T, axes=[1, 1]).swapaxes(0, 1)

#Warning: this code generation is experimental. Please inspect the code for any bugs before executing.