Let A be an array of shape (n_0, n_1, …, n_p-2, n_p-1) with arbitrary p.
A
(n_0, n_1, …, n_p-2, n_p-1)
p
Let ind be and array of shape (m_0,
ind
(m_0,