It should be `Mat::n_1dims()`, not `cols()` :)