multiply pytorch’s numbers with many matrices and many vectors

It’s pretty straightforward and intuitive with einsum:

torch.einsum('ijk, ikl->ijl', mats, vecs)

But your operation is just:

mats @ vecs

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top