* is elementwise multiplication, if you’re using Python3 you can use @ operator as matrix-vector and matrix-matrix multiplication. Otherwise you can always resort to batch_v.mm(M) (since batched vector matrix is just matrix-matrix multiplication).