I already saw How to combine dimensions in numpy array?
And tried that, but when I tried
imgs.reshape(img.shape[:-2]+(-1))
which I assumed would be the logical extension, I get an error:
can only concatenate tuple (not "int") to tuple
I was going to comment on the accepted answer from the linked question and ask them for help directly instead of creating a new thread for this but I don't have the required reputation to comment.
Edit:
For example, I have an input array that is of shape (x,y,8,8) where x and y can change depending on the image that is fed into the function. I want to make it into an array of shape (x,y,64). The 64 in this case never changes.