How to multiply a vector of nx1 to a matrix of nxmxk?

How to multiply a vector A of nx1 to a matrix B of nxmxk? What I want is each element of A to be multiplied to each matrix mxk of B.

I’m not sure I understand your question properly, but you could do something like the following in PyTorch 0.2

result = A[:, :, None] * B

But I’m not sure that’s the operation you want to perform. If you write it down, I could have a better look.