Query shape of n-dimensional array