Kolya Ivankov
Kolya Ivankov

Reputation: 139

Multidimensional tensor product in PyTorch

In pytorch I have to tensors of dimensions [K,L,M] and [M,L,N]. I want to perform a standard tensor convolution product of those tensors along the middle two dimensions to obtain a [K,N] tensor. I couldn't find official documentation on how to perform those operations, perhaps it should be better done in some other library and then reconverted to pytorch tensor?

Upvotes: 1

Views: 1130

Answers (1)

xzkxyz
xzkxyz

Reputation: 545

If by convolution you actually mean something like contraction, you're probably looking for torch.tensordot. You can specify the indices that should be contracted.

Upvotes: 2

Related Questions