mask = ~np.eye(n, dtype=bool)
return np.broadcast_to(a, (n, n, a.shape[-1]))[mask].reshape(n, n - 1, -1)
Creating a tiled multi-dimensional array while removing the sub element of the I'th index of axis0?