Schnelles äußeres Tensorprodukt in Anzahl
Ich habe zwei numpy Arrays:
x of shape ((d1,...,d_m))
y of shape ((e_1,...e_n))
Ich möchte das äußere Tensorprodukt bilden, das ist das Numpy-Array
z of shape ((d1,...,d_m,e_1,...,e_n))
so das
z[i_1,...,i_n,i_{n+1}...,i_{m+n}] == x[i_1,...i_m]*y[i_{m+1},...,i_{m+n}]
Ich muss die obige äußere Multiplikation mehrmals durchführen, damit ich sie so schnell wie möglich ausführen kann.