Oh I’ve just found out something that works: torch.bmm(matrices,vectors.permute(1,0).unsqueeze(2)).squeeze().permute(1,0).
So I have another question: is there any way to avoid these permutes and [un]squeeze? Should I organize my arrays differently?