Please explain me what exactly happening in the einsum of the below code. The output of the code gives a size of (6,6,6,6,6) tensor. Does is actually performing a outer product?
import numpy as np
a1 = np.arange(6)
a2 = np.arange(6)
a3 = np.arange(6)
a4 = np.arange(6)
a5 = np.arange(6)
oo = np.einsum('i,j,k,l,m',a1,a2,a3,a4,a5)
Each element of the 6,6,6,6,6 tensor is the result of the product of the elements from the input arrays,
i.e. the element
oo[0,2,3,0,1] will be a1[0] * a2[2] * a3[3] * a4[0] * a5[1]