jtlap propose to say that a.push_back(x) works on the ndims(a) dimension (so HxWx1 push_back onto HxW gives Hx 2*W) and have a push_back(x,n) to disambiguate other cases.