static inline MatShape concat(const MatShape& a, const MatShape& b) { MatShape c = a; c.insert(c.end(), b.begin(), b.end()); return c; }
static inline MatShape shape(int a0, int a1=-1, int a2=-1, int a3=-1) { int dims[] = {a0, a1, a2, a3}; MatShape s = shape(dims, 4); s.erase(std::remove_if(s.begin(), s.end(), is_neg), s.end()); return s; }