Hello,
I’m trying to figure out how to do the following operation in general (and if it has a name).  I am given a list of tensors [X_1,X_2,...,X_k] all of which are of shape n by m.  I want to do the following operation:
T_{i_1,...,i_k} = \sum_m [X_1]_{m,i_1}*[X_2]_{m,i_2} *...* [X_k]_{m,i_k}.

I can do this easily for a fixed number of tensors by doing:
torch.einsum('ni,nj,nk,nl -> ijkl', [X,Y,Z,W])

However, this is not satisfactory for unknown length lists.  Any thoughts on how to implement this well?