`x.ndim` might be a better way.