Умножения нет, так как есть только один аргумент:
In [25]: arr = np.arange(36).reshape(1,6,1,6)
In [26]: arr
Out[26]:
array([[[[ 0, 1, 2, 3, 4, 5]],
[[ 6, 7, 8, 9, 10, 11]],
[[12, 13, 14, 15, 16, 17]],
[[18, 19, 20, 21, 22, 23]],
[[24, 25, 26, 27, 28, 29]],
[[30, 31, 32, 33, 34, 35]]]])
In [27]: np.einsum('ijij->ij', arr)
Out[27]: array([[ 0, 7, 14, 21, 28, 35]])
Это einsum
фактически diagonal
.
In [29]: np.einsum('ii->i', arr.squeeze())
Out[29]: array([ 0, 7, 14, 21, 28, 35])
In [30]: np.diagonal(arr.squeeze())
Out[30]: array([ 0, 7, 14, 21, 28, 35])