>>> X_ordered = np.take_along_axis(X, np.expand_dims(idx, (2, 3)), 1) >>> X_ordered.shape (2, 10, 64, 64)