Matrix-Vector Multiplication over Batch

Hi everyone,
to compute a custom loss function I want to multiply a matrix of size (k x n), with n being the number of rows in one feature vector, with a batched feature vector of length (n * batch_size).
Is there an efficient way to achieve this?

Can you post a minimal reproducible example or pseudocode of what you want to do?