Tensordot equivalent in pytorch

Helloe veryone, I’ve been using tensorflow and numpy for a while, but now I wanted to dedicate myself to pytorch. My only problem is that I need to do a custom layer, which uses tensordot (https://www.tensorflow.org/api_docs/python/tf/tensordot) in tensorflow.

is there something in pytorch that I can use that is close to that tensordot?

There’s no tensordot in PyTorch. You can simulate it using a combination of exapand, * (mul), and sum.

Tensordot seems generally useful. If you’d like it, file an issue on the PyTorch github repo:

I adapted the numpy tensordot implementation to pytorch: pytorch tensordot

For future readers: torch.tensordot is now available.