Could be `xi = xi.reshape(-1, xi.shape[-1])` as in next change.