Hello!
My question is the following:
I have 2 3D tensors, and with one dimension in common.
1st tensor dimensions: a x b x c
2nd tensor dimensions: a x d x e
I want to multiply these two tensors along the dimension they have in common (a), and such that their output will be a 4 d tensor (e.g. dimensions b x c x d x e). Pretty much multiplying each vector (with a elements) of tensor 1 by each vector (with a elements) of tensor 2.
I can’t think of an easy built-in way to accomplish this. I can think of iterating over the dimensions and performing torch.dot, but that does not look very good. Does any one know of a better way?
Thank you for reading.