Inner product of Tensors

183 Views Asked by At

Can someone please explain me how to do inner product of two tensors in python to get one dimensional array. For example, I have two tensors with size (6,6,6,6,6) and (6,6,6,6). I need an one dimensional array of size (6,1) or (1,6).

1

There are 1 best solutions below

0
Abhinav Mathur On

Numpy has a function tensordot, check it out:
https://numpy.org/doc/stable/reference/generated/numpy.tensordot.html